Since the recent upgrade of Nagios from the 3.X version to 4.0.7, suddenly found that nagiosql can not restart Naigos, check a lot of information is not able to solve, finally, finally found in a forum, just not easy ah.
Cause: Because the nagiosql restart message format is still 3.x, and the 4.x version of the Nagios restart command format has changed.
Workaround:
Modify the Nagiosql verify.php so that it $strcommandstring = "[". Mktime (). "] Restart_program; ". Mktime (); are updated to $strcommandstring = "[". Mktime (). "] Restart_program\n "; The information that is available for nagios feedback is: I has checked that. Nagios 4.0.0 have a command queue-this ist located by default:
/usr/local/nagios/var/rw/nagios.cmd
But the old nagiosql command does isn't work with Nagios 4.0.0. So-edit verify.php and modify line 345 from:
$strCommandString = "[". Mktime (). "] Restart_program; ". Mktime ();
To:
$strCommandString = "[". Mktime (). "] Restart_program\n ";