Problems with external script, cacti don't get data :(
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Your welcome. It was mostly listening anyway Don't know why it was using stderr. That did not make sense.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Hi,
I've the same problem with a perl script that problem describes by Frivas.
In cacti log:
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_default:183108800' [map class_default->class_default]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bsi:28438141' [map class_bsi->class_bsi]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bus:448205483' [map class_bus->class_bus]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_priority:98542952' [map class_priority->class_priority]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_undef:7827063' [map class_undef->class_undef]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_default:754050245' [map class_default->class_default]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bsi:90486731' [map class_bsi->class_bsi]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bus:1602218251' [map class_bus->class_bus]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_priority:707548059' [map class_priority->class_priority]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_undef:13167626' [map class_undef->class_undef]
05/23/2005 12:00:21 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti-0.8.6b/rra/wdir01_classmap_5_bw_7544.rrd --template 1116842401:U
OK u:0.08 s:0.20 r:19.47
ERROR: Not enough arguments
OK u:0.08 s:0.20 r:19.47
05/23/2005 12:00:21 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti-0.8.6b/rra/sbxrv02_5min_cpu_964.rrd --template 5min_cpu 1116842401:62
I use cactid as poller ...
Do you have an idea on this problem ?
Thks a lot
Lionel.
I've the same problem with a perl script that problem describes by Frivas.
Code: Select all
#!/usr/bin/perl
#------------------------------------------------------------------------------
# poll.pl parse la configuration qos d'un routeur et retrouve les indexes
# adéquats pour obtenir la bande passante et les drops pour chaque
# class-map.
#------------------------------------------------------------------------------
$router=shift;
$gcn=shift;
die "Usage : poll.pl <router> <gcn>\n" if (($router eq '') || ($gcn eq ''));
$oid=".1.3.6.1.4.1.9.9.166.1"; # référencement de la mib cisco-class-based-qos-mib
$snmpwalk="/usr/local/bin/snmpwalk";
$snmpget="/usr/local/bin/snmpget";
# Interfaces sur lesquelles on a défini une qos.
$oidspecific="$oid.1.1.1.4"; # cbQosIfIndex
@output=`$snmpwalk $router -c $gcn $oidspecific -v 2c`;
$nboutputline=@output;
$counter=0;
while ($counter < $nboutputline)
{
chop($output[$counter]);
$output[$counter] =~ s/ //g;
@fields=split(/=/,$output[$counter]);
$value=$fields[1];
$value=~s/INTEGER://g;
@key=split(/\./,$fields[0]);
$nblevel=@key;
$nblevel--;
#print("$key[$nblevel];$value\n");
$PolicyMap{$key[$nblevel]}=$value;
$counter++;
}
@objecttype=('','policymap','classmap','matchStatement','queueing','randomDetect','trafficShapping','police','set');
foreach $entry (sort keys %PolicyMap) # Pour chaque Policy-Map,
{
# on recherche tous les qos-objets associes
$oidspecific="$oid.5.1.1.3.$entry"; # cbQosObjectsType
@output=`$snmpwalk $router -c $gcn $oidspecific -v 2c`;
$nboutputline=@output;
$counter=0;
while ($counter < $nboutputline)
{
chop($output[$counter]);
$output[$counter] =~ s/ //g;
@fields=split(/=/,$output[$counter]);
$value=$fields[1];
$value=~s/INTEGER://g;
@key=split(/\./,$fields[0]);
$nblevel=@key;
$nblevel--;
#print("$key[$nblevel];$objecttype[$value]\n");
$key=$entry.".".$key[$nblevel];
$Object{$key}=$objecttype[$value];
$counter++;
}
}
$u=0;
foreach $entry (sort keys %Object) # Pour chaque qos-objet,
{
# on recherche la bande passante utilisee apres application de la policy
if ($Object{$entry} eq "classmap")
{
$oidspecific="$oid.15.1.1.10.$entry"; # cbQosCMPolicyByte64
$output=`$snmpget $router -c $gcn $oidspecific -v 2c`;
chop($output);
$output =~ s/ //g;
@fields=split(/=/,$output);
$value=$fields[1];
#print("$value\n");
$value =~ s/Counter64://;
@fields=split(/\./,$entry);
$Value{$fields[0]}.=":".$value;
# pour cacti ...
$out.="classmap_".$u."_bw:".$value." ";
$oidspecific="$oid.15.1.1.14.$entry"; # cbQosCMDropPkt64
$output=`$snmpget $router -c $gcn $oidspecific -v 2c`;
chop($output);
$output =~ s/ //g;
@fields=split(/=/,$output);
$value=$fields[1];
$value =~ s/Counter64://;
@fields=split(/\./,$entry);
$Value{$fields[0]}.=":".$value;
# pour cacti ...
$out.="classmap_".$u."_drop:".$value." ";
$u++;
}
}
# On alimente la DB
foreach $entry (sort keys %PolicyMap) # Pour chaque policy-map,
{
$data=$Value{$entry}.":U:U"; # on ajoute des valeurs Unknow pour la future classmap video
$interface=$PolicyMap{$entry};
$rrdname="/usr/local/mrtg-2/db/WinSwde/qos/".$router."_qos_".$interface.".rrd";
#$maj=`/usr/local/rrdtool-1.0.45/bin/rrdtool update $rrdname $data`;
print ("$out\n");
}
In cacti log:
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_default:183108800' [map class_default->class_default]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bsi:28438141' [map class_bsi->class_bsi]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bus:448205483' [map class_bus->class_bus]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_priority:98542952' [map class_priority->class_priority]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_undef:7827063' [map class_undef->class_undef]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_default:754050245' [map class_default->class_default]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bsi:90486731' [map class_bsi->class_bsi]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_bus:1602218251' [map class_bus->class_bus]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_priority:707548059' [map class_priority->class_priority]
05/23/2005 11:45:04 AM - POLLER: Poller[0] Parsed MULTI output field 'class_undef:13167626' [map class_undef->class_undef]
05/23/2005 12:00:21 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti-0.8.6b/rra/wdir01_classmap_5_bw_7544.rrd --template 1116842401:U
OK u:0.08 s:0.20 r:19.47
ERROR: Not enough arguments
OK u:0.08 s:0.20 r:19.47
05/23/2005 12:00:21 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/local/cacti-0.8.6b/rra/sbxrv02_5min_cpu_964.rrd --template 5min_cpu 1116842401:62
I use cactid as poller ...
Do you have an idea on this problem ?
Thks a lot
Lionel.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Do you have this problem using cmd.php? If not, then I would suspect that you have a trailing blank in your script output or an extra blank within the code. The validation logic is very touchy and more so in Cactid.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
TheWitness wrote:Do you have this problem using cmd.php? If not, then I would suspect that you have a trailing blank in your script output or an extra blank within the code. The validation logic is very touchy and more so in Cactid.
TheWitness
I use poller.php with cactid 0.8.6d
With cmd.php, this script works well.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
You should then trim the output before you return it from the script. This will fix the issue.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
TheWitness wrote:You should then trim the output before you return it from the script. This will fix the issue.
TheWitness
Thks the problem is solved
I use a function trim before return the string :
Code: Select all
sub trim {
my $string = shift;
for ($string) {
s/^\s+//;
s/\s+$//;
}
return $string;
}
Export Graph template ?
About Cisco QoS stats :
I also see those threads and will have a look at them :
http://forums.cacti.net/viewtopic.php?t=7401
http://forums.cacti.net/viewtopic.php?t=17775
I also see those threads and will have a look at them :
http://forums.cacti.net/viewtopic.php?t=7401
http://forums.cacti.net/viewtopic.php?t=17775
Cacti 0.8.8b + spine 0.8.8b
on Debian / Apache 2.2 / PHP 5.2 / MySQL 5.0
on Debian / Apache 2.2 / PHP 5.2 / MySQL 5.0
Who is online
Users browsing this forum: No registered users and 0 guests