Re: [Nagios-users] Restart service problem with sudo [Solved]

2007-03-28 Thread Andy Shellam
Well that is strange!! Perhaps it's the MySQL script that needs a console tty? Anyway, glad it's sorted! Regards Andy. Sil wrote: > With the log test the problem has solved himself : > I've try my script with this command line > > /usr/bin/sudo /etc/init.d/mysql restart > /tmp/debug.log 2>&1 >

Re: [Nagios-users] Restart service problem with sudo [Solved]

2007-03-28 Thread Sil
With the log test the problem has solved himself : I've try my script with this command line /usr/bin/sudo /etc/init.d/mysql restart > /tmp/debug.log 2>&1 And the service has start !!! The log was : Stopping MySQL database server: mysqld. Starting MySQL database server: mysqld. Checking for crash

Re: [Nagios-users] Restart service problem with sudo

2007-03-27 Thread Sil
Le mardi 27 mars 2007 21:00, Andy Shellam a écrit : > check your /etc/sudoers > file does not have a "defaults requiretty" option set - if it does, > comment it out and try your event handler again. Thanks, I check my sudoers file and there's no "defaults requiretty" line but I've try it and the

Re: [Nagios-users] Restart service problem with sudo

2007-03-27 Thread Andy Shellam
In your Nagios event handler definition, add the following after it: > /tmp/debug.log 2>&1 (e.g. /etc/init.d/mysql restart > /tmp/debug.log 2>&1) Then examine the file after nagios has run the event handler. What that should do is output any info and errors returned from the command to debug.l

Re: [Nagios-users] Restart service problem with sudo

2007-03-27 Thread Andy Shellam
Hi Sil I had a similar problem with NRPE - an NRPE check worked fine when doing it from the command-line, but it refused to work from the NRPE itself. I eventually found out that my /etc/sudoers was denying anything without a terminal from using sudo. It might be the same problem, might not, bu

Re: [Nagios-users] Restart service problem with sudo

2007-03-27 Thread Marc Powell
> -Original Message- > From: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Sil > Sent: Tuesday, March 27, 2007 4:05 AM > To: nagios-users@lists.sourceforge.net > Subject: [Nagios-users] Restart service problem with sudo > > Hi, &g

[Nagios-users] Restart service problem with sudo

2007-03-27 Thread Sil
Hi, I want to test the event-handler for restarting services on my Debian Sarge with Nagios 1.3. I've change the sudoers permissions to accord nagios user to run /etc/init.d/mysql restart : Host_Alias SERVEUR = 192.168.X.X User_Alias NAGIOS = nagios Cmnd_Alias SERVICES= /etc/ini