Restart service problem with sudo

Marc Powell marc at ena.com
Tue Mar 27 15:58:13 CEST 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Sil <Spam>
> Sent: Tuesday, March 27, 2007 4:05 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Restart service problem with sudo
> 
> 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 :

[chop]
 
> when I execute :
> nagios at serveur$ /usr/lib/nagios/plugins/eventhadlers/restart-mysql
> CRTICAL SOFT 3
> Mysql restarts and I see this log :
> Mar 26 15:05:34 localhost sudo:   nagios : TTY=pts/1 ;
> PWD=/var/log/nagios ; USER=root ; COMMAND=/etc/init.d/mysql restart
> 
> But when nagios works alone :
> Mar 26 15:04:40 localhost sudo:   nagios : TTY=unknown ; PWD=/   ;
> USER=root ; COMMAND=/etc/init.d/mysql restart
> Nothing append !
> 
> I don't understand anything, command line is run but mysql nerver
starts !
> Thanks for your help

Either the troubleshooting step taken of redirecting the output of the
call to your script or the sudoers change in the post below will likely
help you out.

http://article.gmane.org/gmane.network.nagios.user/45953/match=sudo

--
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 at 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





More information about the Users mailing list