check_icmp check_host_alive报错
近期在做nagios + check_mk分布式时遇到的一个问题,就是在检测主机是否alive时出错,提示必须要以root用户或用户权限为root的用户,或sudo的方式执行check_icmp插件。具体报错内容如下:
1Warning: This plugin must be either run as root or setuid root.
2To run as root, you can use a tool like sudo.
3To set the setuid permissions, use the command:
4 chmod u+s yourpluginfile
奇怪的是之前在nrpe插件方式检测时从没遇到过该问题,不过该问题的解决方式也已经说的比较明白。通过chmod u+s check_icmp即可:
1/usr/local/nagios/libexec # chown root:nagios check_icmp
2/usr/local/nagios/libexec # chmod 4711 check_icmp 或
3/usr/local/nagios/libexec # chmod u+s check_icmp
4/usr/local/nagios/libexec # ls -alt check_icmp
5-rws--x--x 1 root nagios 107328 3月 28 12:55 check_icmp
执行完以上操作后,把用户切成nagios用户,再执行check_icmp hostip,如果不报错,正常执行,就说明已经OK 。
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/check-icmp-host-alive-error/3057.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.