因为最近将Nagios从3.X版本升级到了4.0.7,忽然发现nagiosQL没法重启Naigos,查了不少资料都是没有可以解决,最后,终于在一个论坛中找到,只是不容易呀。php
致使缘由:由于nagiosql的重启消息格式仍是3.x的,而4.x版本的nagios重启命令格式已经改变。ios
解决方法:sql
修改nagiosql的verify.php,使其$strCommandString = "[".mktime()."] RESTART_PROGRAM;".mktime(); 都更新为$strCommandString = "[".mktime()."] RESTART_PROGRAM\n";便可
Nagios反馈的信息是:
I have checked that. Nagios 4.0.0 has a command queue - this ist located by default: /usr/local/nagios/var/rw/nagios.cmd But the old NagiosQL command does not 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";