PHP Poler return no vaules, command line returns values

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
fireman63
Posts: 8
Joined: Mon Aug 16, 2010 3:31 pm

PHP Poler return no vaules, command line returns values

Post by fireman63 »

Hi,

I am having some issues with a php script I have modified to run in cacti. My goal is to use snmp on a linux box to get memory statics. I went though the forums and found some scripts and templates others have made in the past. I then modified it to work with the newer catci via documentation I found on cacti web site.

I am only have one issue. When I test the script via script_server.php it works and returns values. When cacti runs the script via the poller (cmd.php) I returns values of 0.

I'm sure I am missing something that is in the manual (and yes I thought I read it).

This what I get when I run it from the command line:

Code: Select all

[root@devserver cacti]# php ./script_server.php
PHP Script Server has Started - Parent is cmd
/var/www/cacti/scripts/ss_netsnmp_memory_usage.php ss_netsnmp_memory_usage 192.168.80.35 PASS 2 161 500
totalReal:1923156 availReal:1389636 totalSwap:2104472 availSwap:2104472 memBuffer:153992 memCached:294148 usedReal:85380 usedSwap:0
This is what I get from the cacti logs:

Code: Select all

08/16/2010 01:40:04 PM - CMDPHP: Poller[0] Host[8] DS[153] SERVER: /var/www/cacti/scripts/ss_netsnmp_memory_usage.php ss_netsnmp_memory_usage 192.168.80.35 PASS 2 161 500, output: totalReal:0 availReal:0 totalSwap:0 availSwap:0 memBuffer:0 memCached:0 usedReal:0 usedSwap:0 
Any ideas?

Thanks

Fireman
Dude
Cacti User
Posts: 73
Joined: Wed Aug 11, 2010 11:44 pm

Post by Dude »

check poller cache...
try rebuilding it.
fireman63
Posts: 8
Joined: Mon Aug 16, 2010 3:31 pm

Post by fireman63 »

Thanks for the suggestion. I did check the poller cache it looked good. However I did rebuild it just to make sure. Next I am going to do a tcpdump just to see what is being sent and received.

Code: Select all

Script Server: /var/www/cacti/scripts/ss_netsnmp_memory_usage.php ss_netsnmp_memory_usage 192.168.80.35 PASS 2 161 500
	RRD: /var/www/cacti/rra/cltdacaws01_usedreal_153.rrd 
fireman63
Posts: 8
Joined: Mon Aug 16, 2010 3:31 pm

Post by fireman63 »

So I did some tcpdump for the snmp traffic. I noticed a difference but don't know why.

When I run the code using script_server.php it makes multi snmp-get requests and receives multi snmp-get replies, one for each OID.

When the poller runs the code it makes one snmp-get request with multi OID request and gets a response, all 0's for values.

Is this a feature of the poller?
fireman63
Posts: 8
Joined: Mon Aug 16, 2010 3:31 pm

Post by fireman63 »

Sorry, missed some info in last post.

When I look at the response packet information it had 5 OID bindings as I would expect and they all have values in the packet. However the poller does not recognize them or something.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests