Data Query doesn't get all data in XML file.

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

Moderators: Developers, Moderators

Post Reply
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Data Query doesn't get all data in XML file.

Post by Burvil »

Hi all,

I'm trying to set up a data query, per the following how-to -
http://forums.cacti.net/about11288.html ... data+query.

It works well, up until I get to the section 'Apply the Data Query to your Device'. Although the data query is added ok, it only adds some of the items in the XML file. When I choose 'Data query debug information', I get - <p>

Code: Select all

+ Running data query [15].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/prt_consum.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.43.11.1'
+ Located input field 'prtMarkerSuppliesIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.1'
+ Located input field 'prtMarkerSuppliesDescription' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.2.1.43.11.1.1.6'
+ Found item [prtMarkerSuppliesDescription='Black Toner Cartridge HP C4191A'] index: 1 [from value]
+ Found item [prtMarkerSuppliesDescription='Cyan Toner Cartridge HP C4192A'] index: 2 [from value]
+ Found item [prtMarkerSuppliesDescription='Magenta Toner Cartridge HP C4193A'] index: 3 [from value]
+ Found item [prtMarkerSuppliesDescription='Yellow Toner Cartridge HP C4194A'] index: 4 [from value]
+ Found item [prtMarkerSuppliesDescription='Drum Kit HP C4195A'] index: 5 [from value]
+ Found item [prtMarkerSuppliesDescription='Transfer Kit HP C4196A'] index: 6 [from value]
+ Found item [prtMarkerSuppliesDescription='Fuser Kit HP 120V C4197A 220V C4198A'] index: 7 [from value]
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/prt_consum.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/prt_consum.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/prt_consum.xml'
I also cannot associate the graph template I created earlier in following the instructions, as it isn't even listed. Iv'e attached a screenshot of my browser, as well as the XML file.

Why doesn't it query for the other items in the xml file? I've checked it a couple times, and can't see anything wrong with it. I simply used the host_disk.xml file already included with cacti as a guide. I also used snmpwalk to probe the oids on this printer, and it turned out the values I expected. I figure that may be a reason why I can't associate a graph template...

[/img]
Attachments
Screenshot problem data query.
Screenshot problem data query.
data_query_not_working.gif (19.73 KiB) Viewed 2971 times
prt_consum.xml
XML data file
(1.15 KiB) Downloaded 120 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

For the outputted values, see if they appear when you click on 'create graphs for this host' in the top right corner.
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Post by Burvil »

Well, I clicked 'Create Graphs for this Host', and yes, they did show up. I clicked on the items to create them, and will check the logs in a bit to see if anything happened.

However, it seems from the verbose output in my original posting that there isn't even any data being updated to the rrd... otherwise, wouldn't the verbose listing list more information, like the OIDs of the current level of toner?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

The verbose output will only show you the 'input' data types. Both 'input' and 'output' data types will be shown in the 'create graphs' screen. For example, the 'SNMP - Interface Statistics' associated data template does not show the actual data with a verbose query....
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Post by Burvil »

Well, none of the rrd files were updated recently, so it makes sense there's no data in the graph. I just can't figure out why...

Incidentally, there are only some rrd files created, even though the data template (see attached image) specifies more.

Code: Select all

# ls -lt /var/www/html/cacti/rra/a6_2454_4500* | head -20
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:16 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_245.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:16 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_247.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:16 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_250.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:16 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_246.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:16 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_249.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:15 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_248.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 14:15 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_251.rrd
-rw-r--r--    1 cactiuse cactiuse    95324 Feb 23 14:15 /var/www/html/cacti/rra/a6_2454_4500_today_print_213.rrd
-rw-r--r--    1 cactiuse cactiuse    95324 Feb 23 14:15 /var/www/html/cacti/rra/a6_2454_4500_total_print_214.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 23 07:26 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_239.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:41 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_244.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:41 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_243.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:41 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_242.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:40 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_241.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:40 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_240.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 14:40 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_238.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 11:20 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_236.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 11:20 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_237.rrd
-rw-r--r--    1 cactiuse cactiuse   749236 Feb 22 11:20 /var/www/html/cacti/rra/a6_2454_4500_cyan_max_235.rrd
-rw-r--r--    1 cactiuse cactiuse    95324 Aug 18  2005 /var/www/html/cacti/rra/a6_2454_4500_img_toner_max_212.rrd
Attachments
Screenshot of data template
Screenshot of data template
data_template1.gif (34.76 KiB) Viewed 2937 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please follow the last link of my signature. This pertains to SNMP Data Queries. To sum up, the Data Template definition is wrong. If you had a Data Input Method that spits out all the values in one run, the Data Template would be fine ...
Reinhard
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Post by Burvil »

Hm, well, I checked both the last and second to last writeups in your signature:
"HowTo: Using Data Queries and Data Input Methods (walkthrough)", and "Howto: from snmptable to XML Graphs (Data Query walkthrough)".

Since the former contains information about a data templates and the latter doesn't, I assume you meant the former. Is that correct? If so, I followed that and I don't see where my data template is wrong. Can you point out where it's off?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Sorry for that. After posting, I reckoned I was wrong, but did not find the post anymore. Let me have another try
Reinhard
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Post by Burvil »

Reinhard - were you able to try this again?

Thanks, Burvil
========================
Burvil * http://www.burvil.org *
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Sorry for not being responsive. I'll try next week
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Burvil wrote:However, it seems from the verbose output in my original posting that there isn't even any data being updated to the rrd... otherwise, wouldn't the verbose listing list more information, like the OIDs of the current level of toner?
Verbose Output will never have any influence on rrd's. It is more like an Online Execution of the OIDs given by <direction>input</direction> XML fields. So the output of Verbose Query looks good
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Data Query doesn't get all data in XML file.

Post by gandalf »

Burvil wrote:Hi all,

I'm trying to set up a data query, per the following how-to -
http://forums.cacti.net/about11288.html ... data+query.
From the image, I assume, that you may have associated the Graph Templates directly to the Host. As to my howto, this is wrong. You will have to associate the Graph Templates to the Data Query, then add the Data Query to the List of Associated Data Queries for that host.
To verify, please post a screenshot of your current Data Query Definition
Reinhard
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

As to your Data Template:
You defined data sources of each index of the Data Query. This is wrong. Your XML file defines two <direction>output</direction> fields. Please create one data source for each of those fields, e.g. prtMarkerSuppliesMaxCapacity and prtMarkerSuppliesLevel. You'll notice, that I prefer to take the field names of the XML for the data sources as well (This is my personal way of doing this; there is no need for this. You may use e.g. max and current as well)
This will create a single rrd file for each index (in normal words: toner cartridge) containing two data sources each. That's the way Queries are working with cacti.

Of course, you may choose an alternative approach, if you want all data sources to reside in one single rrd: Then you'll have to write a wrapper Data Input Method. The advantage of the Data Query approach is, that this allows even for black-cartridge-only printers. In this case, you will need a single rrd file only.

Reinhard

PS: your XML file seems to be ok. I verified this with a "normal" HP Printer.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests