Need help with getting data to appear on graphs correctly

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

Moderators: Developers, Moderators

Post Reply
rhygin
Posts: 5
Joined: Thu Mar 10, 2005 12:58 pm

Need help with getting data to appear on graphs correctly

Post by rhygin »

I have written a PHP script that resides in <cacti>/scripts and returns output similar to the following:

Code: Select all

contacts:5 6xx:0 5xx:0 4xx:128 3xx:0 2xx:29
All of these are counter values and will continually increase.

I used existing templates to model the graph and data templates for graphing these values but it never shows up right.

I've attached a image of the graph output as well as the xml file for the templates, can anyone see what's going wrong....
Attachments
Image of broken graph
Image of broken graph
problem.png (2.38 KiB) Viewed 2590 times
cacti_graph_template_ser_sip_statistics.xml
XML templates
(28.83 KiB) Downloaded 213 times
User avatar
solefald
Posts: 38
Joined: Fri Jun 11, 2004 1:35 pm

Post by solefald »

i dont think anyone would want to import your XML file for god-knows-what into their cacti install.

Instead of that submit screenshots of your

Data Input Method (you have one setup, right?)
and
Data Template for this particula script
rhygin
Posts: 5
Joined: Thu Mar 10, 2005 12:58 pm

Post by rhygin »

Here's the screenshots....
Attachments
data_template1.png
data_template1.png (14.86 KiB) Viewed 2548 times
data_template2.png
data_template2.png (21.92 KiB) Viewed 2548 times
graph_template1.png
graph_template1.png (26.51 KiB) Viewed 2548 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Run the polling cycle once with debug mode enabled and post the output for the relevant sections.
rhygin
Posts: 5
Joined: Thu Mar 10, 2005 12:58 pm

Post by rhygin »

Here's the relevant stuff:

Code: Select all

03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field 'contacts:5' [map contacts->contacts]
03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field '6xx:0' [map 6xx->6xx]
03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field '5xx:3' [map 5xx->5xx]
03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field '4xx:228' [map 4xx->4xx]
03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field '3xx:0' [map 3xx->3xx]
03/12/2005 02:52:58 PM - POLLER: Poller[0] Parsed MULTI output field '2xx:66' [map 2xx->2xx]
03/12/2005 02:52:58 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/localhost/htdocs/cacti/rra/torgw2_2xx_108.rrd --template contacts:6xx:5xx:4xx:3xx:2xx 1110657164:5:0:3:228:0:66
Notice how there's 6 fields in the template but 7 values are being passed, I assume this is the root of my problem but have no idea where that 7th (well 1st really) value is coming from. It's obviously a timestamp but should it be in the datafields without a template item for it?
rhygin
Posts: 5
Joined: Thu Mar 10, 2005 12:58 pm

Post by rhygin »

Nevermind about that timestamp field, I checked the output for other updates that had multi output and they had it as well. The problem is that the timestemp is obviously being used for the key contacts.

Anyone seen this before, did I miss something in the data template or input method?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

It appears that cacti is properly finding the data values and updating the rra file. I would check that you're using the right type of data source type (counter, gauge, etc). You could also dump your rra file (rrdtool dump filename.rra > filename.xml) and verify the fields in the rra are being updated with the values.
rhygin
Posts: 5
Joined: Thu Mar 10, 2005 12:58 pm

Post by rhygin »

Ok, so i've done a bunch more fiddling and the contacts field is now updating and displaying properly. The weird thing is the other values never update and I'm still kind of stumped as to why.

After running a dump of the rrd file each of the data sources have values, for instance:

Code: Select all

        <ds>
                <name> 2xx </name>
                <type> COUNTER </type>
                <minimal_heartbeat> 600 </minimal_heartbeat>
                <min> 0.0000000000e+00 </min>
                <max> 1.0000000000e+08 </max>
                <!-- PDP Status -->
                <last_ds> 70 </last_ds>  <--- this is the correct value
                <value> 0.0000000000e+00 </value>
                <unknown_sec> 0 </unknown_sec>
        </ds>
But if you go down the dump further none of the rows have any values for anything except the contacts input field (which is a gauge, the rest are counters).

Code: Select all

<!-- 2005-03-12 23:50:00 EST / 1110689400 --> <row><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v><v> 0.0000000000e+00 </v><v> 3.0000000000e+00 </v></row>
Any other ideas or pointers for me to try....
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests