Single graph from multiple rows in indexed SNMP Data Query?

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

Moderators: Developers, Moderators

Post Reply
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Single graph from multiple rows in indexed SNMP Data Query?

Post by tbessie »

Hi all...

So I looked around here for how I might get multiple rows back from an indexed SNMP Data Query, and then graph a value from each row on a single graph. I saw references to looking at the snmp_queries/interface.xml query, but I couldn't figure out what I'm supposed to do to make this work.

Does anyone have any specific advice on how to do this? I followed the "how to" for SNMP Data Queries, but it only shows how to graph values from a single row on a graph.

- Tim
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

interfaces is kind of confusing since it has so many graph templates, but it works for what you want. basically just look at the "In/Out Bits" graph template at top and see that it has two data-sources associated with the single graph. then load up the XML definition file for the data query ("<path_cacti>/resource/snmp_queries/interface.xml") and see how it is passing the request, and also how it is parsing the results that are needed to fill the data-sources with actual data.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

To graph multiple unique indexes, you should create an snmp xml script (like interfaces.xml), and all required graph/data templates.

Once thats working for a single instance, then you can create custom graph(s) which contain the multiple 'rows' -- actually Indexes. Another method is to use the aggregate plugin to quickly do this for you.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Still another question...

Post by tbessie »

Still have another question about this; I appear to have it working. However, each row in the returned dataset has a different "name" value I want to display on the graph, for each of the graphed lines (eg. "This line represents [replacement string]".

How can I embed this replacement string - which is a column from the returned query dataset - into a string value below the graph?

That is, for each graph template item, I want a string displayed next to the color block at the bottom of the graph which is extracted from the same row in the query results that the data for that element came from.

- Tim
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

In order to do that, you must use an SNMP XML script. Furthermore this field must be an INPUT value (which then gets cached in the cacti db). Then in the graph template (or data query suggested values field), you use |query_XML_FIELD_NAME|. Once again, look at the SNMP - Interface Statistics and interface.xml for a working example.
almen
Posts: 1
Joined: Mon May 25, 2009 8:36 am

Same problem....

Post by almen »

Hi all,

tbessie I've your same problem. I'd like to graph statistics from 2 different NIC on the same graph, but I don't understand how to actually do it.

Any hints?

- Alme
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:In order to do that, you must use an SNMP XML script. Furthermore this field must be an INPUT value (which then gets cached in the cacti db). Then in the graph template (or data query suggested values field), you use |query_XML_FIELD_NAME|. Once again, look at the SNMP - Interface Statistics and interface.xml for a working example.
Thanks, got it! I was using the field's "name" value, and not the name of the field itself.

- Tim
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest