I have a Cacti 0.8.7i installation running on a CentOS 5.5 (i686).
It seems Spine does not fetch correctly values output from PHP script server. They seems to be shifted (the output is not associated with the correct counter).
The following patch solves the problem but I don't understand exactly what is happening:
Code: Select all
--- php.c.orig 2012-03-23 17:25:36.000000000 +0100
+++ php.c 2012-03-23 17:02:31.000000000 +0100
@@ -408,8 +408,14 @@
/* check pipe to insure startup took place */
if (php_process == PHP_INIT) {
result_string = php_readpipe(i);
+ if (!strstr(result_string, "Started") && (trim(result_string)[0] == '\0')) {
+ result_string = php_readpipe(i);
+ }
}else{
result_string = php_readpipe(php_process);
+ if (!strstr(result_string, "Started") && (trim(result_string)[0] == '\0')) {
+ result_string = php_readpipe(php_process);
+ }
}
if (strstr(result_string, "Started")) {
Code: Select all
DEBUG: The log_destination variable is 4 (STDOUT)
DEBUG: The path_php variable is /usr/bin/php
DEBUG: The availability_method variable is 3
DEBUG: The ping_recovery_count variable is 2
DEBUG: The ping_failure_count variable is 2
DEBUG: The ping_method variable is 1
DEBUG: The ping_retries variable is 1
DEBUG: The ping_timeout variable is 450
DEBUG: The snmp_retries variable is 2
DEBUG: The log_perror variable is 1
DEBUG: The log_pwarn variable is 1
DEBUG: The boost_redirect variable is 0
DEBUG: The log_pstats variable is 1
DEBUG: The threads variable is 100
DEBUG: The polling interval is 300 seconds
DEBUG: The number of concurrent processes is 3
DEBUG: The script timeout is 5
DEBUG: The number of php script servers to run is 1
DEBUG: Host List to be polled='409', TotalPHPScripts='1
DEBUG: The PHP Script Server is Required
DEBUG: The Maximum SNMP OID Get Size is 40
Version 0.8.7i starting
DEBUG: MySQL is Thread Safe!
DEBUG: Spine is running asroot.
SPINE: Initializing Net-SNMP API
DEBUG: Issues with SNMP Header Version information, assuming old version of Net-SNMP.
SPINE: Initializing PHP Script Server(s)
DEBUG: SS[0] PHP Script Server Routine Starting
DEBUG: SS[0] PHP Script Server About to FORK Child Process
DEBUG: SS[0] PHP Script Server Child FORK Success
ERROR: SS[999] Script Server did not start properly return message was:
NOTE: Spine will support multithread device polling.
NOTE: Spine is behaving in a 0.8.7g+ manner
DEBUG: Initial Value of Active Threads is 0
DEBUG: Valid Thread to be Created
DEBUG: In Poller, About to Start Polling of Host
Host[0] TH[1] Total Time: 0.001 Seconds
Host[0] TH[1] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
DEBUG: The Value of Active Threads is 1
DEBUG: Valid Thread to be Created
DEBUG: In Poller, About to Start Polling of Host
Host[409] DEBUG: Entering ICMP Ping
DEBUG: The Value of Active Threads is 2
DEBUG: The Value of Active Threads is 1
Host[409] DEBUG: ICMP Host Alive, Try Count:1, Time:9.2531 ms
Host[409] PING: Result ICMP: Host is Alive
Host[409] TH[1] RECACHE: Processing 1 items in the auto reindex cache for '12.34.56.78
Host[409] TH[1] Recache DataQuery[12] OID: .1.3.6.1.2.1.1.3.0, output: 520921215
Host[409] TH[1] NOTE: There are '208' Polling Items for this Host
Host[409] TH[1] DS[5805] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 1, output: U
Host[409] TH[1] DS[5805] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifOutOctets 1, output: 134153709
Host[409] TH[1] DS[5806] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifOutOctets 80, output: 128933806
Host[409] TH[1] DS[5806] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 80, output: 151616406
Host[409] TH[1] DS[5807] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 81, output: 118614662
Code: Select all
DEBUG: The log_destination variable is 4 (STDOUT)
DEBUG: The path_php variable is /usr/bin/php
DEBUG: The availability_method variable is 3
DEBUG: The ping_recovery_count variable is 2
DEBUG: The ping_failure_count variable is 2
DEBUG: The ping_method variable is 1
DEBUG: The ping_retries variable is 1
DEBUG: The ping_timeout variable is 450
DEBUG: The snmp_retries variable is 2
DEBUG: The log_perror variable is 1
DEBUG: The log_pwarn variable is 1
DEBUG: The boost_redirect variable is 0
DEBUG: The log_pstats variable is 1
DEBUG: The threads variable is 100
DEBUG: The polling interval is 300 seconds
DEBUG: The number of concurrent processes is 3
DEBUG: The script timeout is 5
DEBUG: The number of php script servers to run is 1
DEBUG: Host List to be polled='409', TotalPHPScripts='1
DEBUG: The PHP Script Server is Required
DEBUG: The Maximum SNMP OID Get Size is 40
Version 0.8.7i starting
DEBUG: MySQL is Thread Safe!
DEBUG: Spine is running asroot.
SPINE: Initializing Net-SNMP API
DEBUG: Issues with SNMP Header Version information, assuming old version of Net-SNMP.
SPINE: Initializing PHP Script Server(s)
DEBUG: SS[0] PHP Script Server Routine Starting
DEBUG: SS[0] PHP Script Server About to FORK Child Process
DEBUG: SS[0] PHP Script Server Child FORK Success
DEBUG: SS[0] Confirmed PHP Script Server running using readfd[7], writefd[6]
NOTE: Spine will support multithread device polling.
NOTE: Spine is behaving in a 0.8.7g+ manner
DEBUG: Initial Value of Active Threads is 0
DEBUG: Valid Thread to be Created
DEBUG: In Poller, About to Start Polling of Host
DEBUG: The Value of Active Threads is 1
DEBUG: Valid Thread to be Created
DEBUG: In Poller, About to Start Polling of Host
DEBUG: The Value of Active Threads is 2
Host[0] TH[1] Total Time: 0.0036 Seconds
Host[0] TH[1] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
DEBUG: The Value of Active Threads is 1
Host[409] DEBUG: Entering ICMP Ping
Host[409] DEBUG: ICMP Host Alive, Try Count:1, Time:9.9970 ms
Host[409] PING: Result ICMP: Host is Alive
Host[409] TH[1] RECACHE: Processing 1 items in the auto reindex cache for '12.34.56.78
Host[409] TH[1] Recache DataQuery[12] OID: .1.3.6.1.2.1.1.3.0, output: 520923820
Host[409] TH[1] NOTE: There are '208' Polling Items for this Host
Host[409] TH[1] DS[5805] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 1, output: 134154327
Host[409] TH[1] DS[5805] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifOutOctets 1, output: 128934400
Host[409] TH[1] DS[5806] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifOutOctets 80, output: 151617064
Host[409] TH[1] DS[5806] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 80, output: 118615220
Host[409] TH[1] DS[5807] SS[0] SERVER: /cacti/scripts/get_interface3.php ss_get_interface 12.34.56.78 409 2:161:500:40:public get ifInOctets 81, output: 118882146