> I finally got it working but it was not that easy. As I am using CentOS 5, > by default the requiretty value in the /etc/sudoers file is activated, so > I > had to edit it like this: > #Defaults requiretty > nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_procs > > And the command in the .cfg file would be like this: > command[check_total_procs]=sudo /usr/local/nagios/libexec/check_procs -w > 150 -c 200
It's a bit safer to use this right before the user and command definition: Defaults:nagios !requiretty That way, you're leaving the restriction in place for *other* users, you're just overriding it for the nagios user. Benny -- "Death rays, advanced technology or not, no creature wants to be stabbed in their hoo-hoo." -- Seen on zombiehunters.org ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null