Multiple Data Sources.... Help!
Moderators: Developers, Moderators
Multiple Data Sources.... Help!
New cacti user.
I have a python script that generates the following output:
[root@mon02 voice]# ./vox_trunk_fadif.py --trunk-id=35
vox_trunk_attempted:6 vox_trunk_completed:7
For some reason cacti is not graphing the second value. I went and looked at the rrd file, and I see this:
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1212877811 </lastupdate> <!-- 2008-06-07 22:30:11 UTC -->
<ds>
<name> vox_trunk_completed </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> U </last_ds>
<value> NaN </value>
<unknown_sec> 11 </unknown_sec>
</ds>
<ds>
<name> vox_trunk_attempted </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> 6 </last_ds>
<value> 6.6000000000e+01 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives --> <rra>
As you can see, cacti is picking up a value of 'U' for the vox_trunk_completed data source. Why would it do that? Where is it getting 'U' from? I have a data template with the two data sources in it.
I can't figure out what's going on. I've deleted everything from the graph right down to the data input method and recreated multiple times and it keeps doing it.
Help!
I have a python script that generates the following output:
[root@mon02 voice]# ./vox_trunk_fadif.py --trunk-id=35
vox_trunk_attempted:6 vox_trunk_completed:7
For some reason cacti is not graphing the second value. I went and looked at the rrd file, and I see this:
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1212877811 </lastupdate> <!-- 2008-06-07 22:30:11 UTC -->
<ds>
<name> vox_trunk_completed </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> U </last_ds>
<value> NaN </value>
<unknown_sec> 11 </unknown_sec>
</ds>
<ds>
<name> vox_trunk_attempted </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+02 </max>
<!-- PDP Status -->
<last_ds> 6 </last_ds>
<value> 6.6000000000e+01 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives --> <rra>
As you can see, cacti is picking up a value of 'U' for the vox_trunk_completed data source. Why would it do that? Where is it getting 'U' from? I have a data template with the two data sources in it.
I can't figure out what's going on. I've deleted everything from the graph right down to the data input method and recreated multiple times and it keeps doing it.
Help!
Thanks.
I know my script is ok, because I went and changed the python script I had to just this:
#!/bin/sh
echo "vox_trunk_attempted:6 vox_trunk_completed:7"
Can't go wrong with that. I also went and compared everything (data input method, data template, graph template, data source, graph) side by side, screen by screen to another graph where, for some reason, I actually got it to work. As far as I can tell, they are the same.
I looked at the cacti logs. They aren't indicating any errors. I rebuilt the poller cache too.
What else could it be?
I know my script is ok, because I went and changed the python script I had to just this:
#!/bin/sh
echo "vox_trunk_attempted:6 vox_trunk_completed:7"
Can't go wrong with that. I also went and compared everything (data input method, data template, graph template, data source, graph) side by side, screen by screen to another graph where, for some reason, I actually got it to work. As far as I can tell, they are the same.
I looked at the cacti logs. They aren't indicating any errors. I rebuilt the poller cache too.
What else could it be?
Ok, I turned up the cacti debug. I see this:
06/08/2008 05:40:08 PM - CMDPHP: Poller[0] Host[81] DS[2058] CMD: /var/www/cacti/scripts/voice/vox_trunk_fadif.py --trunk-id=35, output: vox_trunk_attempted:6 vox_trunk_completed:7
That looks ok to me. If I compare it against the older one that works, it's output is:
06/08/2008 05:40:10 PM - CMDPHP: Poller[0] Host[81] DS[1996] CMD: /var/www/cacti/scripts/voice/vox_idd_fadif.py --idd-code=92, output: vox_idd_attempted:0 vox_idd_completed:0
Know that the id of rrd file on the one that isn't working is 2058, I also found:
06/08/2008 05:45:13 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (2058, '', '2008-06-08 17:45:11', 'vox_trunk_attempted:6 vox_trunk_completed:7')"
For the one that is working, the rrd id is 1975:
06/08/2008 05:45:14 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (1975, '', '2008-06-08 17:45:11', 'vox_idd_attempted:8 vox_idd_completed:2')"
The output format of these two data sources looks to be the same.
I did notice this difference however.
For the working one:
06/08/2008 05:46:49 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_idd_completed_1975.rrd --template vox_idd_attempted:vox_idd_completed 1212947111:8:2
For the non working one:
06/08/2008 05:46:08 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_trunk_completed_2058.rrd --template vox_trunk_attempted 1212947111:6
As you can see, for the non working one, cacti has dropped the vox_trunk_attempted variable. Why would it do that when it's getting the correct output from the script?
Actually, that last comparison made no sense. Now I'm confused.
06/08/2008 05:40:08 PM - CMDPHP: Poller[0] Host[81] DS[2058] CMD: /var/www/cacti/scripts/voice/vox_trunk_fadif.py --trunk-id=35, output: vox_trunk_attempted:6 vox_trunk_completed:7
That looks ok to me. If I compare it against the older one that works, it's output is:
06/08/2008 05:40:10 PM - CMDPHP: Poller[0] Host[81] DS[1996] CMD: /var/www/cacti/scripts/voice/vox_idd_fadif.py --idd-code=92, output: vox_idd_attempted:0 vox_idd_completed:0
Know that the id of rrd file on the one that isn't working is 2058, I also found:
06/08/2008 05:45:13 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (2058, '', '2008-06-08 17:45:11', 'vox_trunk_attempted:6 vox_trunk_completed:7')"
For the one that is working, the rrd id is 1975:
06/08/2008 05:45:14 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (1975, '', '2008-06-08 17:45:11', 'vox_idd_attempted:8 vox_idd_completed:2')"
The output format of these two data sources looks to be the same.
I did notice this difference however.
For the working one:
06/08/2008 05:46:49 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_idd_completed_1975.rrd --template vox_idd_attempted:vox_idd_completed 1212947111:8:2
For the non working one:
06/08/2008 05:46:08 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_trunk_completed_2058.rrd --template vox_trunk_attempted 1212947111:6
As you can see, for the non working one, cacti has dropped the vox_trunk_attempted variable. Why would it do that when it's getting the correct output from the script?
Actually, that last comparison made no sense. Now I'm confused.
There is no 'Update RRD File' check box on the input variables, if that's what you meant.
However, both vox_trunk_completed and vox_trunk_attempted output fields in the data input method have 'Update RRD File' checked. There is only one input to the script, trunkid.
The command line to the Script/Cmd in the data input method is:
<path_cacti>/scripts/voice/vox_trunk_fadif.py --trunk-id=<trunkid>
trunkid is an input variable, vox_trunk_completed and vox_trunk_attempted are output variables.
However, both vox_trunk_completed and vox_trunk_attempted output fields in the data input method have 'Update RRD File' checked. There is only one input to the script, trunkid.
The command line to the Script/Cmd in the data input method is:
<path_cacti>/scripts/voice/vox_trunk_fadif.py --trunk-id=<trunkid>
trunkid is an input variable, vox_trunk_completed and vox_trunk_attempted are output variables.
I created the data input method first, followed by the data template, then the graph template, then the data source and finally the graph. I've repeated the whole process from scratch maybe half a dozen times and it's failed to work each time, except for that one before... which apparently I now can't repeat.
5 days later, and I still can't work out what's wrong with this and why it isn't working.
I started from scratch AGAIN, and cranked up the output. Here's all the relevant log lines I could find:
06/09/2008 07:50:07 AM - CMDPHP: Poller[0] Host[81] DS[2060] CMD: /var/www/cacti/scripts/voice/vox_trunk_fadif.py --trunk-id=35, output: vox_trunk_attempted:6 vox_trunk_completed:7
06/09/2008 07:50:07 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (2060, '', '2008-06-09 07:50:06', 'vox_trunk_attempted:6 vox_trunk_completed:7')"
06/09/2008 07:50:09 AM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select data_template_rrd.data_source_name, data_input_fields.data_name from (data_template_rrd,data_input_fields) where data_template_rrd.data_input_field_id=data_input_fields.id and data_
template_rrd.local_data_id=2060"
06/09/2008 07:50:10 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='2060' and rrd_name='' and time='2008-06-09 07:50:06'"
06/09/2008 07:50:11 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_trunk_attempted_2060.rrd --template vox_trunk_attempted 1212997806:6
..... Right there! Where the heck did vox_trunk_completed go???
I started from scratch AGAIN, and cranked up the output. Here's all the relevant log lines I could find:
06/09/2008 07:50:07 AM - CMDPHP: Poller[0] Host[81] DS[2060] CMD: /var/www/cacti/scripts/voice/vox_trunk_fadif.py --trunk-id=35, output: vox_trunk_attempted:6 vox_trunk_completed:7
06/09/2008 07:50:07 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id, rrd_name, time, output) values (2060, '', '2008-06-09 07:50:06', 'vox_trunk_attempted:6 vox_trunk_completed:7')"
06/09/2008 07:50:09 AM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select data_template_rrd.data_source_name, data_input_fields.data_name from (data_template_rrd,data_input_fields) where data_template_rrd.data_input_field_id=data_input_fields.id and data_
template_rrd.local_data_id=2060"
06/09/2008 07:50:10 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "delete from poller_output where local_data_id='2060' and rrd_name='' and time='2008-06-09 07:50:06'"
06/09/2008 07:50:11 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/voice_data_server_vox_trunk_attempted_2060.rrd --template vox_trunk_attempted 1212997806:6
..... Right there! Where the heck did vox_trunk_completed go???
Who is online
Users browsing this forum: No registered users and 5 guests