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.