因爲最近將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";