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 result is :
Mar 27 19:21:01 localhost sudo:   nagios : sorry, you must have a tty to run 
sudo ; TTY=unknown ; PWD=/var/log/nagios ; USER=root ; 
COMMAND=/etc/init.d/mysql restart

and if I change the line in "defaults ! requiretty" or if I remove it the 
resultis the same :
Mar 27 19:23:01 localhost sudo:   nagios : TTY=unknown ; PWD=/var/log/nagios ; 
USER=root ; COMMAND=/etc/init.d/mysql restart
But mysql don't restart.
I don't understand. :-(

I test a cron job too with the plugin on the agios user and it works !
# 23 19 27 3 2 /usr/lib/nagios/plugins/eventhandlers/restart-mysql CRITICAL 
SOFT 3
The log (the same) :
Mar 27 19:38:21 localhost sudo:   nagios : TTY=unknown ; PWD=/var/log/nagios ; 
USER=root ; COMMAND=/etc/init.d/mysql restart
And mysql restarts !

It's very strange a cron job works but a nagios command fail and no logs have 
any errors.

If someone have any ideas...
Thanks
Sil

PS sorry for the aswer on your personal adress.

Répondre à