先做基本查錯。
在log看到以下訊息:
ERROR: Input Expected, Script Server Terminating
PHP Script Server communications lost. Restarting PHP Script Server
查了網路上的教學,一般是建議手動執行script_server.php來除錯。但我一執行就有錯誤訊息:(在另一台主機就沒有)
php -q script_server.php
PHP Script Server has Started - Parent is cmd
ERROR: Input Expected, Script Server Terminating
網路上有人教更進一步的除錯,終於有了比較明顯的訊息。感覺是主機的問題,造成parser時好時壞。(這主機很多人在裝套件我自己也更新過PHP之類的),不曉得是哪一個環節出了問題。
php -q poller.php --force --debug
/usr/share/cacti/site/scripts/ss_cisco-cpm.php: line 1: ?php
:
/usr/share/cacti/site/scripts/ss_cisco-cpm.php: line 2: /bin:
/usr/share/cacti/site/scripts/ss_cisco-cpm.php: line 3: syntax error near unexpected token `$_SERVER["argv"][0]'
/usr/share/cacti/site/scripts/ss_cisco-cpm.php: line 3: `if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {
'
此題暫時無解,就再觀望一下吧目前是用另一台librenms先頂著用。
順便比較一下Get Script Server Data與Get Script Data的差異:
Get Script Server Data(Indexed):
在執行的時候需要指定function (ss_ciscocpm),因此只能在script_server.php的環境下除錯 (但在我的狀況下由於一執行script_server就當掉,因此無法除錯)
SERVER: /usr/share/cacti/site/scripts/ss_cisco-cpm.php ss_ciscocpm mydevice 55 2:161:5000:1:10:public:::::: get 1min 2082, output: 2
Get Script Data(Indexed):
不用指定function,因此也可以直接在cli下除錯。
SCRIPT: /usr/share/cacti/site/scripts/ss_cisco-cpm.php mydevice 55 2:161:5000:1:10:public:::::: get 1min 2082, output: U
例如:
php -q /usr/share/cacti/site/scripts/ss_cisco-cpm.php mydevice 4 2:161:5000:1:10:public:::::: get 1min 82
沒有留言:
張貼留言