[solved] graphing output from script w/ multi output fields

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

Moderators: Developers, Moderators

Post Reply
billysneed
Posts: 2
Joined: Fri Dec 21, 2012 9:09 am

[solved] graphing output from script w/ multi output fields

Post by billysneed »

Hello -

I have a python script that grabs the total number of ports and the active number of ports on a switch. It spits out the data formatted as "Total:<n> Active:<n>".

I'm only seeing the graphed info from the Total field, the Active field is always listed as 0, regardless of the value.
TotalAndActive.png
TotalAndActive.png (12.04 KiB) Viewed 479 times
I turned up the logging and see the output correctly in the logfile:
cacti>grep "Host\[714\]" cacti.log | grep Active
12/21/2012 09:55:38 AM - CMDPHP: Poller[0] Host[714] DS[50199] CMD: /usr/bin/python /usr/share/cacti/scripts/getCiscoActivePorts.py <sanitizedIP>, output: Active:5 Total:35
12/21/2012 10:00:38 AM - CMDPHP: Poller[0] Host[714] DS[50199] CMD: /usr/bin/python /usr/share/cacti/scripts/getCiscoActivePorts.py <sanitizedIP>, output: Active:5 Total:35
12/21/2012 10:05:38 AM - CMDPHP: Poller[0] Host[714] DS[50199] CMD: /usr/bin/python /usr/share/cacti/scripts/getCiscoActivePorts.py <sanitizedIP>, output: Active:5 Total:35
12/21/2012 10:10:38 AM - CMDPHP: Poller[0] Host[714] DS[50199] CMD: /usr/bin/python /usr/share/cacti/scripts/getCiscoActivePorts.py <sanitizedIP>, output: Total:35 Active:5
I tried swapping the order of the output to see if that made a difference, but it didn't. Using 'rrdtool dump' (below) I see the .rrd file is listing a "U" value for the Active field, which I'm guessing is because something is invalid. I just can't figure out what it is that is invalid. The data template & graph template _seem_ to be just fine. Can anyone point me towards a source of the issue?

cacti>rrdtool dump 115_franklin_active_50199.rrd
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "http://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1356103838 </lastupdate> <!-- 2012-12-21 10:30:38 EST -->

<ds>
<name> Total </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 4.9600000000e+02 </max>

<!-- PDP Status -->
<last_ds> 35 </last_ds>
<value> 1.3300000000e+03 </value>
<unknown_sec> 0 </unknown_sec>
</ds>

<ds>
<name> Active </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 4.9600000000e+02 </max>

<!-- PDP Status -->
<last_ds> U </last_ds>
<value> NaN </value>
<unknown_sec> 38 </unknown_sec>
</ds>

<!-- Round Robin Archives --> <rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->

<params>
<xff> 5.0000000000e-01 </xff>
</params>
<cdp_prep>
<ds>
<primary_value> 3.5000000000e+01 </primary_value>
<secondary_value> 0.0000000000e+00 </secondary_value>
<value> NaN </value>
<unknown_datapoints> 0 </unknown_datapoints>
</ds>
<ds>
<primary_value> NaN </primary_value>
<secondary_value> 0.0000000000e+00 </secondary_value>
<value> NaN </value>
<unknown_datapoints> 0 </unknown_datapoints>
</ds>
</cdp_prep>
<database>
[ ...snip... ]
Thanks,
Billy
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Issue graphing output from script w/ multi output fields

Post by gandalf »

Please start reading 2nd link of my sig
R.
billysneed
Posts: 2
Joined: Fri Dec 21, 2012 9:09 am

Re: Issue graphing output from script w/ multi output fields

Post by billysneed »

Thanks, I didn't know about that page in the wiki.

My issue ended up being the Maximum value being too low in the Data Source on the Data Template I created for the script. I set that to "U" for no maximum, and started graphing properly.

Thanks

And thanks for this GREAT tool.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests