在配置过程中遇到以下错误:
1,NRPE: Command 'check_http' not defined
2,NRPE: Command 'check_ssh' not defined
3,NRPE: Command 'check_ping' not defined
4,NRPE: Command 'check_disk' not defined
5,NRPE: Command 'check_swap' not defined
6,NRPE: Command 'check_procs' not defined
解决方法:
就是/etc/nagios/nrpe.cfg里面添加相应的command[]配置,例如解决check_http not defined只要加一个command[check_http]就行了。
以下是我在命令行下的测试,只要命令行下OK了,nagios的web监控就不会报错了。
[root@localhost objects]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_http
OK - load average: 1.04, 0.31, 0.10|load1=1.040;15.000;30.000;0; load5=0.310;10.000;25.000;0; load15=0.100;5.000;20.000;0;
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_ping
PING OK - Packet loss = 0%, RTA = 0.04 ms|rta=0.035000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_disk
DISK OK - free space: / 41756 MB (87% inode=96%);| /=6080MB;40316;45356;0;50396
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_ssh
SSH OK - OpenSSH_5.3 (protocol 2.0)
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_swap
SWAP OK - 100% free (10047 MB out of 10047 MB) |swap=10047MB;3014;1004;0;10047
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.1.120 -c check_procs
PROCS CRITICAL: 285 processes
客户端配置很简单,重起一下/etc/init.d/nrpe reload
如果使用了iptables等类似防火墙的话,开一个端口5666,你可以通过netstat来查看端口情况。或者是配置文件。