Added graphs not showing up in poller_item

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

Moderators: Developers, Moderators

User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Added graphs not showing up in poller_item

Post by wwwdrich »

I have a device with broken snmp support that I have written a script_server query for. The query itself seems to work correctly and I can't find anything obvious wrong with my data templates or graph templates. The verbose query for the data query returns the correct number of entries.

The problem comes when I add graphs. The first oddity I noticed is that the checkboxs don't disappear from the create graphs page although it does create the entry for the graphs on the device graph page. The rrd files don't get created, and with that the graphs never populate on the graph page. With a bit of digging I found out that the entries are never getting created for these queries in poller_item. There aren't any errors in the logs, even running in debug mode.

Does anyone know what could cause this to happen? The XML for the query was converted from the old SNMP XML, so it should be valid. The original templates I was using were all converted from the old SNMP queries as well, so they should be correct (and creating new ones from scratch didn't help either). At this point I'm at a loss, so any pointers would be a help!

I have attached the script, the XML, and the templates below.

(for those who are interested, I have to jump through all these hoops because the UPS will only return data on an snmpwalk. Using snmpget on any of the table OIDS returns "no such variable name in this MIB" errors.)
Attachments
netvision_cacti.zip
NetVision UPS cacti query script, XML,and templates
(8.53 KiB) Downloaded 217 times
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Added graphs not showing up in poller_item

Post by gandalf »

wwwdrich wrote:The problem comes when I add graphs. The first oddity I noticed is that the checkboxs don't disappear from the create graphs page although it does create the entry for the graphs on the device graph page. The rrd files don't get created, and with that the graphs never populate on the graph page. With a bit of digging I found out that the entries are never getting created for these queries in poller_item. There aren't any errors in the logs, even running in debug mode.
These issues are the root cause.
No item in poller table -> no datasource created -> no rrd file defined -> nothing greyed out. But I can't tell you from remote why this happens.
R.
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Re: Added graphs not showing up in poller_item

Post by wwwdrich »

gandalf wrote:
wwwdrich wrote:The problem comes when I add graphs. The first oddity I noticed is that the checkboxs don't disappear from the create graphs page although it does create the entry for the graphs on the device graph page. The rrd files don't get created, and with that the graphs never populate on the graph page. With a bit of digging I found out that the entries are never getting created for these queries in poller_item. There aren't any errors in the logs, even running in debug mode.
These issues are the root cause.
No item in poller table -> no datasource created -> no rrd file defined -> nothing greyed out. But I can't tell you from remote why this happens.
R.
Yep, I figured as much. Can you give me some ideas for what to look for as to why there wouldn't be an entry in the poller table? I started digging through the add graph code but gave up before my head exploded.... :-)

I don't have any other script server sources defined, so as soon as I get time I'm going to try converting one of my systems to use the host_disk script server templates and see if those have the same problem.

I should have mentioned, this is Cacti 0.8.7e with the plugin architechture patches running on RedHat RHEL5. That gives me apache 2.2.3, php 5.1.6, and MySQL 5.0.77.
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

For a step-by-step debug, I first need the output of running that script from cli natively and under the script server.
An snmpwalk of one of those indexes would be fine as well.
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

BTB: what do you want to chieve by

Code: Select all

<script_function>ss_host_disk</script_function>
in the XML?
R.
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

gandalf wrote:BTB: what do you want to chieve by

Code: Select all

<script_function>ss_host_disk</script_function>
in the XML?
R.
Proving that I'm and idiot who can't debug his own XML? :-) I could have sworn I changed that when I was converting the file over (I copied it from the host_disk xml and added the modified data from my old SNMP xml for the UPS). Let me fix this on Monday and see if that makes any difference.

Thanks for spotting this, I'm embarrassed that I missed it in the first place...
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

gandalf wrote:For a step-by-step debug, I first need the output of running that script from cli natively and under the script server.
An snmpwalk of one of those indexes would be fine as well.
R.
Here is the cli output (hostnames and community strings have been obfuscated):

Code: Select all

drich@renuka|111> sudo -u cactiuser php ./ss_netvision_ups_output.php ups.fubar.com 24 1:161:60:2:10:public index
1
2
3
drich@renuka|112> sudo -u cactiuser php ./ss_netvision_ups_output.php ups.fubar.com 24 1:161:60:2:10:public get voltage 1
2310
drich@renuka|117> sudo -u cactiuser php ./ss_netvision_ups_output.php usp.fubar.com 24 1:161:60:2:10:public query current
1!590
2!600
3!630
For the script server itself, here is what I see:

Code: Select all

PHP Script Server has Started - Parent is cmd
ss_netvision_ups_output.php ss_netvision_ups_output ups.fubar.com 24 1:161:60:2:10:public index
1
2
3
U
ss_netvision_ups_output.php ss_netvision_ups_output ups.fubar.com 24 1:161:60:2:10:public get voltage 1
2310
ss_netvision_ups_output.php ss_netvision_ups_output ups.fubar.com 24 1:161:60:2:10:public get voltage 2
2310
ss_netvision_ups_output.php ss_netvision_ups_output ups.fubar.com 24 1:161:60:2:10:public get voltage 3
2300
ss_netvision_ups_output.php ss_netvision_ups_output ups.fubar.com 24 1:161:60:2:10:public get current 1
590
And here is what the SNMP tables look like:

Code: Select all

SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.1.3 = INTEGER: 3
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.2.1 = INTEGER: 2310
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.2.2 = INTEGER: 2310
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.2.3 = INTEGER: 2300
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.3.1 = INTEGER: 590
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.3.2 = INTEGER: 600
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.3.3 = INTEGER: 630
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.4.1 = INTEGER: 20
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.4.2 = INTEGER: 20
SNMPv2-SMI::enterprises.4555.1.1.1.1.4.4.1.4.3 = INTEGER: 21
And a verbose query via. the cacti device interface:

Code: Select all

+ Running data query [17].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: query index'
+ Found item [upsOutputLineIndex='1'] index: 1
+ Found item [upsOutputLineIndex='2'] index: 2
+ Found item [upsOutputLineIndex='3'] index: 3
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please try attached XML and post results of a verbose query.
R.
Attachments
netvision_ups_output.xml
(1.24 KiB) Downloaded 191 times
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

gandalf wrote:Please try attached XML and post results of a verbose query.
R.
That gives exactly what I would expect -- the values for each of the three snmp walks:

Code: Select all

+ Running data query [17].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: query index'
+ Found item [upsOutputLineIndex='1'] index: 1
+ Found item [upsOutputLineIndex='2'] index: 2
+ Found item [upsOutputLineIndex='3'] index: 3
+ Executing script query '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: query voltage'
+ Found item [upsOutputVoltage='2310'] index: 1
+ Found item [upsOutputVoltage='2310'] index: 2
+ Found item [upsOutputVoltage='2300'] index: 3
+ Executing script query '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: query current'
+ Found item [upsOutputCurrent='570'] index: 1
+ Found item [upsOutputCurrent='580'] index: 2
+ Found item [upsOutputCurrent='620'] index: 3
+ Executing script query '/usr/bin/php -q /var/www/html/cacti-0.8.7e/scripts/ss_netvision_ups_output.php ttpups200kva01.ddu-india.com 24 1:161:750:2:10:public:::MD5::DES: query load'
+ Found item [upsOutputPercentLoad='19'] index: 1
+ Found item [upsOutputPercentLoad='20'] index: 2
+ Found item [upsOutputPercentLoad='21'] index: 3
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
+ Found data query XML file at '/var/www/html/cacti-0.8.7e/resource/script_server/netvision_ups_output.xml'
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That suspects a bug in the code responsible for making the poller_item entries. Please open a bug report to track this. It will take some time to "fake" the situation using your specific script as I do not have access to your devices.
R.
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

I'll dig around a bit in the add_graph code to see if I can find out what might be happening. In the meantime I'll go ahead and add the entries to the poller_items table by hand so I can at least start collecting data.

Thanks for the help!
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

I have been trying to tweak things a bit more, with no success. I have the same problem if I try and make this an indexed script query instead of a script-server query. Everything works from the command line as far as I can tell, but the graphs never populate, the selections on the add graphs page are never disabled, and nothing gets added to the poller_item table.

I even tried re-installing the cacti code, it didn't make any difference. Since other script queries work, I'm convinced I have done something stupid in setting this one up.

Any ideas what could cause graphs to be created but no entries made in poller_item?
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
paxos
Posts: 8
Joined: Fri Apr 30, 2010 1:18 pm

Post by paxos »

I was about to post a similar issue.. but thought I'd check with you to see if we are having the same issue.

I have a script query that I just created.. made all the templates and added a host and created a graph. The data source is listed, but it doesn't appear in the poller cache.

Walking through the cacti code, I found it was not being added to the poller cache because the data source has an 'snmp_query_id' of '0' in the 'data_local' mysql table when it should have a value of '14' per the 'snmp_query' mysql table.

Are you seeing this as well?

I'm running cacti 0.8.7e on gentoo and just recently upgraded from 0.8.7b. I added the new templates and script query after the upgrade.
User avatar
wwwdrich
Cacti User
Posts: 91
Joined: Thu Feb 03, 2005 5:53 pm
Location: San Jose, CA
Contact:

Post by wwwdrich »

I do see snmp_query_id = 0, and I am running 0.8.7e on this machine. Oddly enough, there are other graphs on this host that work with snmp_query_id=0 as well, but those were all created on our old server before upgrading to 0.8.7e.

Code: Select all

mysql> select * from data_local where host_id = 24;
+------+------------------+---------+---------------+------------+
| id   | data_template_id | host_id | snmp_query_id | snmp_index |
+------+------------------+---------+---------------+------------+
| 1281 |               94 |      24 |             0 |            | 
| 1282 |              107 |      24 |             0 |            | 
| 1283 |               88 |      24 |             0 |            | 
| 1579 |               88 |      24 |             0 |            | 
| 1709 |              111 |      24 |             0 |            | 
| 1707 |              111 |      24 |             0 |            | 
| 1708 |              111 |      24 |             0 |            | 
+------+------------------+---------+---------------+------------+
7 rows in set (0.00 sec)
- Dan
[i] "Step up to red alert!" "Are you sure, sir?[/i]
[i] It means changing the bulb in the sign..." - Red Dwarf[/i]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

All, if you find some hints, please open a bug report to track this!
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests