> -----Original Message----- > From: Formoso, Travis [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 11:58 AM > To: Marc Powell > Cc: nagios-users > Subject: RE: [Nagios-users] Monitoring question > > > The event handler _is_ being called ("SERVICE EVENT HANDLER"). If you're > > using the example handler as is, it won't work. I'll bet you a free beer > > that the nagios user does not have permission to restart httpd via the > > init script. In cases such as this I use visudo to grant nagios > > passwordless sudo access to the script and call it from the event > > handler via 'sudo /etc/rc.d/init.d/httpd restart'. > > Marc - > > I am running the command line as user root (it is a virtual machine). Do I > still need to set permission for the nagios user to restart httpd. If so
Yes, you do. The nagios program runs as user nagios so logically, any programs that are called from nagios are run as that user. > how do I grant nagios user passwordless access? Also if it is being called 'man sudoers' ;) The hand-holding approach is to -- - run 'visudo' as root - at the end of the file add 'nagios ALL= NOPASSWD: /etc/rc.d/init.d/httpd' - exit your editor - test. Become the nagios user. If you're root, run 'su - nagios' to become the nagios user. Type 'id' to verify that you are indeed nagios, then run 'sudo /etc/rc.d/init.d/httpd restart' and verify that httpd restarted. - modify your event handler script to include 'sudo ' in front of every occurrence of '/etc/rc.d/init.d/httpd' > SERVICE EVENT HANDLER what do I need to change this to and where? It's not being called that. I was just pointing out that nagios was logging that it was running your event handler (described later in those lines). -- Marc ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ 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