-
nagios 主机状态为down,服务状态正常
1.1 服务器禁ping,可能出现如上问题
1.2 手动执行check_ping 命令,部分出现依赖库版本等不支持的现象
参考地址:https://cloud.tencent.com/info/e852399cb0309ee23473526c7f6c5624.html
1.3 CRITICAL - Could not interpret output from ping command
手动使用root用户执行命令输出正常
root@vpn:/usr/local/nagios/libexec# ./check_ping -H 10.1.11.64 -w 500.0,80% -c 1000.0,100% -p 5 PING OK - Packet loss = 0%, RTA = 5.20 ms|rta=5.197000ms;500.000000;1000.000000;0.000000 pl=0%;80;100;0
监控界面点击主机详情,看到ping 命令出现 CRITICAL - Could not interpret output from ping command
问题原因是nagios 用户不具有ping命令执行权限,观察发现ping命令权限设置异常
nagios@vpn:~/libexec$ ./check_ping -H 10.2.11.64 -w 500.0,80% -c 1000.0,100% -p 5 /bin/ping -n -U -w 10 -c 5 10.2.11.64 CRITICAL - Could not interpret output from ping command nagios@vpn:~/libexec$ ls -al /bin/ping -rwxr-xr-x 1 root root 44168 Jul 23 12:56 /bin/ping
为ping命令添加setuid标志
root@vpn:/usr/local/nagios/libexec# chmod u+s /bin/ping root@vpn:/usr/local/nagios/libexec# ls -al /bin/ping -rwsr-xr-x 1 root root 44168 Jul 23 12:56 /bin/ping root@vpn:/usr/local/nagios/libexec# su nagios nagios@vpn:~/libexec$ ./check_ping -H 10.2.11.64 -w 500.0,80% -c 1000.0,100% -p 5 PING OK - Packet loss = 0%, RTA = 5.76 ms|rta=5.759000ms;500.000000;1000.000000;0.000000 pl=0%;80;100;0
nagios 主机状态为down服务监控状态正常
最新推荐文章于 2021-05-12 23:22:18 发布