Login

Home Forum
Welcome, Guest
Please Login or Register.    Lost Password?

patch to re/start nagios
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: patch to re/start nagios
#312
patch to re/start nagios 1 Year, 6 Months ago Karma: -1
Inserted more code to verify.php to enable second option (if nagios is not started, it's down and the pipe does not exist):
Code:

} else {
if (file_exists($SETS['nagios']['binary']) && is_executable($SETS['nagios']['binary'])) {
$resFile = @exec("/usr/bin/sudo -u nagios ".$SETS['nagios']['binary']." -d ".$SETS['nagios']['config']."nagios.cfg");
} else {
$strMessage = $LANG['file']['binaryfail'];
}
$myDataClass->writeLog($LANG['logbook']['startok']);
$strMessage = $LANG['file']['started'];



Into /etc/sudoers insert privileges for your apache user to be able to start nagios program executable by user nagios:
Code:

apache ALL=(ALL) NOPASSWD: /usr/local/nagios/bin/nagios -d /etc/nagios/nagios.cfg

Now nagios starts always.
rumba
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/01/12 18:06 By rumba.
The administrator has disabled public write access.
 
Go to topPage: 1