看完这个之后
[root@wcmisdlin02 alexus]# tail -2 /etc/sudoers ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) #includedir /etc/sudoers.d [root@wcmisdlin02 alexus]#
我现在有以下几点:
[root@wcmisdlin02 ~]# cat /etc/sudoers.d/01_nagios Defaults:nagios !requiretty nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/ [root@wcmisdlin02 ~]#
但我得到我的/var/log/messages
Sep 21 11:14:32 wcmisdlin02 sudo: nrpe : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/lib/nagios/plugins/check_load -w 6,5,4 -c 8,7,6
我究竟做错了什么?
确保NRPE作为nagios用户运行。
如果您将其作为独立服务运行:
ps -ef | grep nrpe grep nrpe_user /path/to/nrpe.cfg
或者,如果你通过TCP包装器运行它:
grep user /etc/xinetd.d/nrpe