*** Poller returning a zero value for perl scripts ***
Moderators: Developers, Moderators
-
- Posts: 17
- Joined: Wed Jun 22, 2005 10:43 pm
*** Poller returning a zero value for perl scripts ***
I have a strange problem where if I run a perl script manually (as cactiuser) then it returns non-zero values, but when the poller runs automatically it returns zeros
I have checked permissions, recreated data sources, run through the "troubleshooting NAN values document" and not sure what else to try ...
[root@cactiserver root]# su - cactiuser
[cactiuser@cactiserver cactiuser]$ /usr/bin/php /usr/local/cacti/poller.php
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'active:3' [map active->active]
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'idle:7' [map idle->idle]
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'total:10' [map total->total]
08/10/2007 09:29:08 AM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /usr/local/cacti/rra/isdn_router_active_124.rrd --template active:idle:total 1186702146:3:7:10
[root@cactiserver root]# tail /usr/local/cacti/log/cacti.log
08/10/2007 09:40:02 AM - CMDPHP: Poller[0] Host[5] DS[124] CMD: /usr/bin/perl /usr/local/cacti/scripts/bchanstat.pl 10.1.1.1 2 public 161, output: active:0 idle:0 total:0
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'active:0' [map active->active]
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'idle:0' [map idle->idle]
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'total:0' [map total->total]
08/10/2007 09:40:02 AM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /usr/local/cacti/rra/isdn_router_active_124.rrd --template active:idle:total 1186702801:0:0:0
Any help would be really appreciated
Thanks
I have checked permissions, recreated data sources, run through the "troubleshooting NAN values document" and not sure what else to try ...
[root@cactiserver root]# su - cactiuser
[cactiuser@cactiserver cactiuser]$ /usr/bin/php /usr/local/cacti/poller.php
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'active:3' [map active->active]
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'idle:7' [map idle->idle]
08/10/2007 09:29:08 AM - POLLER: Poller[0] Parsed MULTI output field 'total:10' [map total->total]
08/10/2007 09:29:08 AM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /usr/local/cacti/rra/isdn_router_active_124.rrd --template active:idle:total 1186702146:3:7:10
[root@cactiserver root]# tail /usr/local/cacti/log/cacti.log
08/10/2007 09:40:02 AM - CMDPHP: Poller[0] Host[5] DS[124] CMD: /usr/bin/perl /usr/local/cacti/scripts/bchanstat.pl 10.1.1.1 2 public 161, output: active:0 idle:0 total:0
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'active:0' [map active->active]
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'idle:0' [map idle->idle]
08/10/2007 09:40:02 AM - POLLER: Poller[0] Parsed MULTI output field 'total:0' [map total->total]
08/10/2007 09:40:02 AM - POLLER: Poller[0] CACTI2RRD: /usr/local/bin/rrdtool update /usr/local/cacti/rra/isdn_router_active_124.rrd --template active:idle:total 1186702801:0:0:0
Any help would be really appreciated
Thanks
-
- Posts: 17
- Joined: Wed Jun 22, 2005 10:43 pm
Hi Reinhard, thanks for the reply and apologies for cross posting. I'm not sure how to delete the other posts.gandalf wrote:Please post a script. If I find time to read it ...
Reinhard
Although I get the desired result when running the script from the command line, the script wont work with the poller. I don't have much knowledge of scripting or how it integrates with the poller. Perhaps you can suggest another way of doing it ?
Much Appreciated
#!/usr/bin/perl
$in_hostname = $ARGV[0] if defined $ARGV[0];
$in_version = $ARGV[1] if defined $ARGV[1];
$in_community = $ARGV[2] if defined $ARGV[2];
$in_port = $ARGV[3] if defined $ARGV[3];
$in_oid = ".1.3.6.1.2.1.10.20.1.2.1.1.2";
if ($in_version eq "2")
{
$in_version = "2c";
}
my $_cmd = "/usr/bin/snmpwalk -v $in_version -c $in_community $in_hostname:$in_port $in_oid";
# usage notes
if (
( ! defined $in_hostname ) ||
( ! defined $in_version ) ||
( ! defined $in_community ) ||
( ! defined $in_port )
) {
print "usage: $0 <host> <snmp version> <snmp community> <snmp port>\n";
exit;
}
my @_output = `$_cmd`;
my $_active = 0;
my $_idle = 0;
my $_total = 0;
foreach ( @_output ) {
$_active++ if /active/;
$_idle++ if /idle/;
$_total++ if /active/+/idle/;
}
print "active:$_active idle:$_idle total:$_total";
-
- Posts: 17
- Joined: Wed Jun 22, 2005 10:43 pm
-
- Posts: 17
- Joined: Wed Jun 22, 2005 10:43 pm
catid info
Hi Reinhard,gandalf wrote:Which poller are you running, cmd.php or cactid? If cactid, which version (./cactid -- version)
Reinhard
I have tried testing with cactid and also another script, but I still gett the same results. Here is my cactid version info:
[root@cacti reporter]# ./cactid --version
CACTID 0.8.6i Copyright 2002-2006 by The Cacti Group
Usage: cactid [options] [firstid lastid]
- Attachments
-
- Comparison of CLI and Poller output
- script-help.JPG (85.45 KiB) Viewed 2709 times
Who is online
Users browsing this forum: No registered users and 4 guests