can't parse error in graph item

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

Moderators: Developers, Moderators

Post Reply
Yvan
Posts: 7
Joined: Wed Apr 02, 2003 2:28 pm
Location: Balegem, BE

can't parse error in graph item

Post by Yvan »

Hi there,

I keep running into the same problem.

All the templates and graphs that ome with the cacti-distribution (version 0.8.4) work great. But once I start adding my own graphs, things go wrong.

When importing the hp-toner xml (found in http://www.raxnet.net/board/viewtopic.php?t=2771) I get an error in my graph: ERROR: can't parse '#CDCFC4:Maximum Toner Level'

This is what the code looks like

Code: Select all

/usr/local/rrdtool-1.0.45/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="lexmark OptraColor 1200 - Toner Level" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
AREA:#CDCFC4:"Maximum Toner Level"  \
LINE1:#000000:"Current Toner Level"  \
GPRINT::LAST:"mg of toner remaining\:%8.0lf" 
When I create a graph from the CLI, it creates a nice graph.

Code: Select all

/usr/local/rrdtool-1.0.45/bin/rrdtool graph toner.gif DEF:mytoner=/home/www/htdocs/cacti/rra/lexmark_optracolor_1200_blk_toner_level_133.rrd:blk_toner_level:AVERAGE LINE2:mytoner#FF0000
We all can see the problem: there is no DEF defined in the cacti graph :(

Now my question is: how do I get it there...

I'm not sure sure if this error is linux-ditro based or not, but I saw the same problem in the Win32 Forum http://www.raxnet.net/board/viewtopic.php?t=2664.


cya,

Yvan
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The graph template that you are trying to use in the other thread is missing two "Graph Item Inputs", one for each data source on the graph. I realize that this is not intuitively obvious and it really should be. I am making a note in my 0.8.5 TODO as we speak.

I also attached a revised copy of the template if you are interested.

-Ian
Attachments
printer-hp-toner_rev1.xml
Toner Level Graph Template (rev1)
(10.39 KiB) Downloaded 1139 times
User avatar
NetVicious
Posts: 49
Joined: Mon Oct 13, 2003 1:14 pm
Location: Spain

Post by NetVicious »

I get this when I try to run the Data Query I get this:

Code: Select all

Warning: Undefined index: script_path in /usr/share/cacti/lib/data_query.php on line 72

Warning: Undefined index: arg_index in /usr/share/cacti/lib/data_query.php on line 82

Warning: Undefined index: arg_index in /usr/share/cacti/lib/data_query.php on line 84

Warning: Variable passed to each() is not an array or object in /usr/share/cacti/lib/data_query.php on line 88

Warning: Cannot add header information - headers already sent by (output started at /usr/share/cacti/lib/data_query.php:72) in /usr/share/cacti/host.php on line 92
.. //\/ e t . \/ i c i o u s ..
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

That is a strange error considering that this XML file does not appear to make use of data queries in any way. If you select "Data Input Methods" on the menu and choose "Get SNMP Data", what is listed for "Input Type"?

-Ian
Guest

Post by Guest »

Input Type: SNMP

I'm using 0.8.5a (upgraded from 0.8.3)
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Perhaps you are going about creating a graph from the XML incorrectly. Here is the process I followed.

1) Import the XML file located in this thread into Cacti.
2) Go to "New Graphs" and choose the device you created for your printer.
3) Under the "Graph Templates" box, choose "Printer - HP - Toner Level", and click "Create" at the bottom of the page.

Let me know how this works for you.

-Ian
wez_db
Posts: 1
Joined: Tue Feb 08, 2005 3:29 am
Location: Hilversum,NL
Contact:

Post by wez_db »

i tried the same, however i don't get a graph but no errors either. :(
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I am not exactly sure what the problem could be. The rev1 template posted in this thread seemed to work correctly for me. Let me walk through the steps that I followed. Before doing anything, make sure any instances of the "HP - Toner Level" template are removed from the data and graph template pages.

1) Download the XML file from this thread.
2) Import the XML file into Cacti, make sure that there are no errors.
3) Make sure that you have created a device for your printer that you are going to monitor the toner level on.
4) Go to the new graphs page, select this device, and select "Printer - HP - Toner Level" from the graph templates dropdown. Now, click the Create button at the bottom, fill in the information and click Create again.

Wait 5 minutes and you should have a working graph. At least those exact steps worked on my 0.8.6c installation.

-Ian
jwc0897
Posts: 1
Joined: Thu Mar 15, 2007 8:55 am

Post by jwc0897 »

Hi, I had the same problem when I tried to import the XML file. Does anyone have an update on this? Thanks!
Attachments
xml-import-error.jpg
xml-import-error.jpg (45.9 KiB) Viewed 6315 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest