vim /usr/local/nagios/etc/nrpe.cfg 配置nrpe文件
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_hda2]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda2 添加了一个检测根分区的命令
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20 -c 10 添加了一个检测交换分区的命令
检测是否能收集到信息:
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_swap
SWAP OK - 100% free (2000 MB out of 2000 MB) |swap=2000MB;0;0;0;2000
## 有些服务器上有防火墙,需要开启端口。
注意:
nagios的日志文件地址:
/usr/local/nagios/var/nagios.log
nagios的日志归档地址:
/usr/local/nagios/var/archives/...