PHP Script in Data Input Method (problem)

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
paweljop
Posts: 1
Joined: Tue Sep 14, 2010 10:45 am

PHP Script in Data Input Method (problem)

Post by paweljop »

Hi all :)

Some details:
OS: Solaris 10
Cacti: 0.8.7.g, cmd.php
PHP 5.2.13
MySQL 5.0.67

I'm trying to use two php scripts as data input methods (ss_netsnmp_memory.php and ss_netsnmp_cpu.php)
Scripts works fine from command line but there is a problem with them in Cacti.

1. When I use only one Data Source (doesn't matter which data input method from above i choose) everything works fine, but
2. when i have two Data Sources - one for ss_netsnmp_memory.php and one for ss_netsnmp_cpu.php only first is working, but second not.

Here You have log when i added "CPU" Data Source first

09/14/2010 05:30:01 PM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '301', Max Runtime '298', Poller Runs: '1'
09/14/2010 05:30:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/bin/php, ARGS: -q "/md2/cacti/htdocs/cmd.php" 0 0]
09/14/2010 05:30:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/bin/php, ARGS: -q "/md2/cacti/htdocs/cmd.php" 2 2]
09/14/2010 05:30:01 PM - POLLER: Poller[0] NOTE: There are no items in your poller for this polling cycle!
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: GETCWD: /
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: DIRNAM: /md2/cacti/htdocs
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: FILENM: /md2/cacti/htdocs/script_server.php
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] PHP Script Server Started Properly
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] SNMP: Host responded to SNMP
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] RECACHE: Processing 1 items in the auto reindex cache for '10.122.10.30'.
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] RECACHE DQ[1]: OID .1.3.6.1.2.1.1.3.0
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] DS[19] SNMP: v2: 10.122.10.30, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 2811938195
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] DS[19] SNMP: v2: 10.122.10.30, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 2440889485
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: PID[28275] CTR[0] INC: 'ss_netsnmp_cpu.php' FUNC: 'ss_netsnmp_cpu' PARMS: '10.122.10.30:2:<community>::'
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] DS[26] SERVER: /md2/cacti/htdocs/scripts/ss_netsnmp_cpu.php ss_netsnmp_cpu 10.122.10.30:2:<community>::, output: cpuUsage:3 cpuCores:2
09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: PID[28275] CTR[0] RESPONSE:''
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] DS[25] WARNING: Result from SERVER not valid. Partial Result: U
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Host[2] DS[25] SERVER: /md2/cacti/htdocs/scripts/ss_netsnmp_memory.php ss_netsnmp_memory 10.122.10.30:2:<community>::, output: U

09/14/2010 05:30:01 PM - PHPSVR: Poller[0] DEBUG: PID[28275] CTR[1] INC: 'ss_netsnmp_memory.php' FUNC: 'ss_netsnmp_memory' PARMS: '10.122.10.30:2:<community>::'
09/14/2010 05:30:01 PM - CMDPHP: Poller[0] Time: 0.3251 s, Theads: N/A, Hosts: 1
09/14/2010 05:30:02 PM - POLLER: Poller[0] Parsed MULTI output field 'cpuUsage:3' [map cpuUsage->cpu_usage]
09/14/2010 05:30:02 PM - POLLER: Poller[0] Parsed MULTI output field 'cpuCores:2' [map cpuCores->cpu_cores]
09/14/2010 05:30:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_mem_real_used_25.rrd --template 1284478201:U
09/14/2010 05:30:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_cpu_cores_26.rrd --template cpu_usage:cpu_cores 1284478201:3:2
09/14/2010 05:30:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_traffic_in_19.rrd --template traffic_out:traffic_in 1284478201:2440889485:2811938195
09/14/2010 05:30:02 PM - SYSTEM STATS: Time:1.3163 Method:cmd.php Processes:10 Threads:N/A Hosts:2 HostsPerProcess:1 DataSources:4 RRDsProcessed:3


and here when "Memory" Data Source was added first:


09/14/2010 05:45:01 PM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '301', Max Runtime '298', Poller Runs: '1'
09/14/2010 05:45:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/bin/php, ARGS: -q "/md2/cacti/htdocs/cmd.php" 0 0]
09/14/2010 05:45:01 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/local/bin/php, ARGS: -q "/md2/cacti/htdocs/cmd.php" 2 2]
09/14/2010 05:45:01 PM - POLLER: Poller[0] NOTE: There are no items in your poller for this polling cycle!
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: GETCWD: /
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: DIRNAM: /md2/cacti/htdocs
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: FILENM: /md2/cacti/htdocs/script_server.php
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] PHP Script Server Started Properly
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] SNMP: Host responded to SNMP
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] RECACHE: Processing 1 items in the auto reindex cache for '10.122.10.30'.
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] RECACHE DQ[1]: OID .1.3.6.1.2.1.1.3.0
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] DS[19] SNMP: v2: 10.122.10.30, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.2, output: 2814455302
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] DS[19] SNMP: v2: 10.122.10.30, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 2443614569
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: PID[2392] CTR[0] INC: 'ss_netsnmp_memory.php' FUNC: 'ss_netsnmp_memory' PARMS: '10.122.10.30:2:<community>::'
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] DS[28] SERVER: /md2/cacti/htdocs/scripts/ss_netsnmp_memory.php ss_netsnmp_memory 10.122.10.30:2:<community>::, output: totalReal:4194304 availReal:3065968 totalSwap:5250808 availSwap:5250808 memBuffer:0 memCached:0 usedReal:1128336 usedSwap:0
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] DS[27] WARNING: Result from SERVER not valid. Partial Result: U
09/14/2010 05:45:01 PM - CMDPHP: Poller[0] Host[2] DS[27] SERVER: /md2/cacti/htdocs/scripts/ss_netsnmp_cpu.php ss_netsnmp_cpu 10.122.10.30:2:<community>::, output: U

09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: PID[2392] CTR[0] RESPONSE:''
09/14/2010 05:45:01 PM - PHPSVR: Poller[0] DEBUG: PID[2392] CTR[1] INC: 'ss_netsnmp_cpu.php' FUNC: 'ss_netsnmp_cpu' PARMS: '10.122.10.30:2:<community>::'
09/14/2010 05:45:02 PM - CMDPHP: Poller[0] Time: 0.3247 s, Theads: N/A, Hosts: 1
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'totalReal:4194304' [map totalReal->mem_real_total]
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'availReal:3065968' [map availReal->mem_real_avail]
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'totalSwap:5250808' [map totalSwap->mem_swap_total]
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'availSwap:5250808' [map availSwap->mem_swap_free]
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'usedReal:1128336' [map usedReal->mem_real_used]
09/14/2010 05:45:02 PM - POLLER: Poller[0] Parsed MULTI output field 'usedSwap:0' [map usedSwap->mem_swap_used]
09/14/2010 05:45:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_mem_real_used_28.rrd --template mem_real_total:mem_real_avail:mem_swap_total:mem_swap_free:mem_real_used:mem_swap_used 1284479101:4194304:3065968:5250808:5250808:1128336:0
09/14/2010 05:45:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_cpu_cores_27.rrd --template 1284479101:U
09/14/2010 05:45:02 PM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /md2/cacti/htdocs/rra/cerber_traffic_in_19.rrd --template traffic_out:traffic_in 1284479101:2443614569:2814455302
09/14/2010 05:45:02 PM - SYSTEM STATS: Time:1.3172 Method:cmd.php Processes:10 Threads:N/A Hosts:2 HostsPerProcess:1 DataSources:4 RRDsProcessed:3

What is the problem...have no idea..

Help please

Best regards
Pawel
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

It seems that you're talking about script server php script, not plain data input method php script. That makes a difference. Please see 1st link of my sig
R.
Post Reply

Who is online

Users browsing this forum: manuelx89 and 2 guests