nagios:
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.14/nrpe-2.14.tar.gz?r=&ts=1363788540&use_mirror=hivelocity
tar zxvfnrpe-2.14.tar.gz
cd nrpe
./configure make all make install-plugin
5. 设置nagios管理密码:
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name
alias
address
}
这个为主机块,需要告诉nagios,计算机名,别名,地址,使用的是 linux
define hostgroup{
hostgroup_name ; The name of the hostgroup
alias ; Long name of the group
members ; Comma separated list of hosts that belong to this group
}
这块为主机组名,别名,成员。
define service{
use local-service ; Name of service template to use
hostgroup_name
service_description checksapce_root
check_command check_local_disk!20%!10%!/root
}
这块就是可以监控的本地的服务名。
define service{
use local-service ; Name of service template to use
hostgroup_name
service_description HTTP
check_command check_http
notifications_enabled 1
}
tar zxvf pnp-0.4.14.tar.gz
cd pnp-0.4.14
./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 all && make install && make install-config && make install-init && make fullinstall
注:rrdtool的安装目录请区别对待,有时候编译时会报错,那是因为没有安装Hiers
yum install perl-Time-HiRes
部分摘自:http://liuxin1982.blog.iyunv.com/uid-20527159-id-3484263.html