I've tweaked and re-tweaked just about everything to do with this particular graph but I can't get any data.
The Problem:
I have a script that prints data, and running the script as is I get output,
Code: Select all
perl /var/www/cacti/scripts/do_ul_stats.pl
Users: 21669
Contacts: 23732
Deleted: 1634348
Expired: 1422781
TCP-Contacts: 9940
TCP-Deleted: 95194
TCP-Expired: 354329
Code: Select all
07/23/2012 12:25:39 PM - SPINE: Poller[0] Host[104] TH[1] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
07/23/2012 12:25:39 PM - SPINE: Poller[0] Host[104] TH[1] Total Time: 5.5 Seconds
07/23/2012 12:25:39 PM - SPINE: Poller[0] Host[104] TH[1] DS[2848] SCRIPT: /var/www/cacti/scripts/do_ul_stats.pl, output: U
07/23/2012 12:25:39 PM - SPINE: Poller[0] Host[104] ERROR: Empty result [dbpstat.wvp.vivox.com]: '/var/www/cacti/scripts/do_ul_stats.pl'
Thanks for your time, and let me know if you need more info.
PS: Here's the script in case that's necessary.
Code: Select all
#!/usr/bin/perl -w
use Data::Dumper;
#change server names *****
open(STATS, "echo 'xserctl|fifo ul_stats|xxx.company.com' | nc proxy.xxx.company.com 6668 |");
my $hdr = <STATS>;
if ($hdr =~ /^Ack|0|0|/) {
$hdr =~ s/^Ack\|0\|0\|//;
@flds = split(' ', $hdr);
} else {
print "Failed to get stats!\r\n";
exit 1;
}
while (<STATS>) {
if (/^'location'/) {
@vals = split ' ';
}
}
if (!defined(@vals)) {
print "Failed to get stats!\r\n";
exit 1;
}
# Build field name -> index mapping
my %index;
@index{@flds} = (0..$#flds);
my $delidx = $index{'Deleted'};
print "Users: ".$vals[$index{'Users'}] . "\r\n";
print "Contacts: ".$vals[$index{'Contacts'}] . "\r\n";
print "Deleted: ".$vals[$index{'Deleted'}] . "\r\n";
print "Expired: ".$vals[$index{'Expired'}] . "\r\n";
print "TCP-Contacts: ".$vals[$index{'TCP-Contacts'}] . "\r\n";
print "TCP-Deleted: ".$vals[$index{'TCP-Deleted'}] . "\r\n";
print "TCP-Expired: ".$vals[$index{'TCP-Expired'}] . "\r\n";