图形显示组件的安装:
图形显示组件需要rrdtool及perl的支持,先安装它们.有关安装rrdtool可以参考[url]http://waringid.blog.51cto.com/65148/58580[/url].
tar zxvf pnp-0.4.10.tar.gz
./configure --with-nagios-user=nagios
--with-nagios-group-nagios
--with-rrdtool=/usr/local/rrdtool/bin/rrdtool
--with-perfdata-dir=/usr/local/nagios/share/perfdata
make
make all
make install
make install-config
make install-init
|
这些安装好后,需要进行相关的设定,这里就不详细介绍各参数,只捡重要的说;可以参考/etc/nagios/objects/localhost.cfg文件.host.cfg用来定义主机名及对应的IP;主机组则是将定义的主机名加入这个组.类似于下面:
define host{ #定义主机名
use remote-server
host_name re.ftp
alias ftp server
address 192.168.42.7
}
define host{
use remote-server
host_name re.edc #用下面的语句可显示太阳图标
action_url /nagios/cgi-bin/extinfo.cgi?host=$HOSTNAME$
process_perf_data 1
alias dc
address 192.168.42.6
}
define hostgroup{ #定义主机组
hostgroup_name windows-servers
alias Windows Servers
members re.win.client
}
define hostgroup{
hostgroup_name remote-server
alias remote-server
members re.edc,re.dc,re.exchange,re.sus,re.back,re.file,
re.phone,re.hr,re.uf,re.oa,re.qy,re.prod,re.ftp
}
|
服务则是用来处理相应的监控请求,和主机文件一样,有相应的服务和服务组.如下所示:
define service{
use remote-service
host_name re.edc,re.dc,re.exchange,re.sus,re.back,re.file,re.phone,
re.hr,re.uf,re.oa,re.qy,re.prod,re.ftp
service_description PING #显示服务的太阳符号
action_url /nagios/cgi-bin/extinfo.cgi?host=$HOSTNAMEcontentamp;srv=$SERVICEDESC$
process_perf_data 1 #产生图形数据
check_command check_ping!100.0,20%!500.0,60%
notifications_enabled 1 #提示联系人
}
define service{
use generic-service
host_name re.win.client
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}
define servicegroup{
servicegroup_name remote-service
alias Check Remote Servers
members re.ftp,FTP
}
define servicegroup{
servicegroup_name windows-service
alias Check Windows servers
members re.win.client,Explorer
}
|
|