5 datasource items in data template -> 25 items in dropdo

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

Moderators: Developers, Moderators

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

5 datasource items in data template -> 25 items in dropdo

Post by tbessie »

So I am trying to graph 5 rows I'm getting from an indexed SNMP data query I've written, all on one graph.

It seems to work fine, except for one odd thing. When I have created a graph with this, and go to "Graph Management", the dropdown for each "graph item field" in the "supplemental graph template data" area shows each of the 5 datasources repeated 5 times, yielding 25 different versions.

I see, for example, the equivalent of:

"dataSource1 (where index == 1)" x 5
"dataSource2 (where index == 2)" x 5
"dataSource3 (where index == 3)" x 5
"dataSource4 (where index == 4)" x 5
"dataSource5 (where index == 5)" x 5

Anybody know what causes this?

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

Post by BSOD2600 »

You messed something up ;).

Does each data source have multiple fields? Multiple devices using that snmp data query?

Possibly consider changing the data source titles to included the device's index #, name or other unique field.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:You messed something up ;).

Does each data source have multiple fields? Multiple devices using that snmp data query?

Possibly consider changing the data source titles to included the device's index #, name or other unique field.
No nooooo! :-)

Each Data Template has 5 Data Source Items, as it should be, since I want to display each of the items on a single graph.

When I did "create graphs for this host" and chose the given Data Source, it created 5 data sources for that host, all with the same name (but different index values). Even if I go and modify each of these created Data Sources to have a different name (reflecting what index value they represent), I still get the big list of 25 data sources per host.

Also, when I initially do the "create graphs for this host", it creates 5 separate graphs; is this normal? I have to go back and delete 4 of them.

Any other suggestions on how to debug this?

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

Post by BSOD2600 »

tbessie wrote:Also, when I initially do the "create graphs for this host", it creates 5 separate graphs; is this normal? I have to go back and delete 4 of them.
Generally not.

Post a screenshot of the data input method, data template, graph template, a data source and graph for this device.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

In addition to this, I added the query parameter variable corresponding to the name of the given row in my SNMP query, to the datasource name.

That works, I get 5 data sources, each with a different name and index. However, when do the "create graphs for host" and select each of the indexes for this indexed query, it creates 5 graphs, 1 Data Source per index, and, as mentioned, the dropdown on
Console -> Graph Management -> Graph Item Fields contains each data source 5 times (each named with the name value tied to the SNMP row index PLUS the name assigned to the index in the Data Query page, yielding 5 x 5 = 25 options).

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

Post by tbessie »

BSOD2600 wrote:
tbessie wrote:Also, when I initially do the "create graphs for this host", it creates 5 separate graphs; is this normal? I have to go back and delete 4 of them.
Generally not.

Post a screenshot of the data input method, data template, graph template, a data source and graph for this device.
Well, there is no data input method, just a data query.

Here are screenshots of everything you mention, plus more. :-)

Data Query:
http://www.timbessie.com/misc/cactiImages/dataQuery.png

Data Query Associated Graph Templates:
http://www.timbessie.com/misc/cactiImag ... plates.png

Data Template:
http://www.timbessie.com/misc/cactiImag ... mplate.png

Graph Template:
http://www.timbessie.com/misc/cactiImag ... mplate.png

Create Graphs for Device:
http://www.timbessie.com/misc/cactiImag ... Device.png

Create Graphs for Device - Done:
http://www.timbessie.com/misc/cactiImag ... e-done.png

Data Sources Created by Above:
http://www.timbessie.com/misc/cactiImag ... ources.png

One of the Data Sources:
http://www.timbessie.com/misc/cactiImag ... xample.png

Graphs Created by Above:
http://www.timbessie.com/misc/cactiImag ... Graphs.png

One of the Graphs:
http://www.timbessie.com/misc/cactiImag ... xample.png

Graph Item Dropdown:
http://www.timbessie.com/misc/cactiImag ... licity.png

Text of SNMP Index Query:

Code: Select all

<interface>

    <name>JVM Memory Pools</name>
    <description>Get JVM Memory Pools</description>
    <index_order_type>numeric</index_order_type>
    <oid_index>.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2</oid_index>
    <oid_index_parse>OID/REGEXP:.*\.([0-9]{1,2})$</oid_index_parse>
    <index_order>Index</index_order>
    <index_order_type>numeric</index_order_type>

    <fields>
        <Index>
            <name>Index</name>
            <source>index</source>
            <direction>input</direction>
        </Index>

        <jvmMemPoolName>
            <name>Name</name>
            <method>walk</method>
            <source>value</source>
            <direction>input</direction>
            <oid>.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2</oid>
        </jvmMemPoolName>

        <jvmMemPoolUsed>
            <name>Used</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11</oid>
        </jvmMemPoolUsed>

    </fields>

</interface>
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Ah, there we go, you DO have multiple things in your data template. Why are there 5 pools? Per your snmp xml script, there should only be 1.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:Ah, there we go, you DO have multiple things in your data template. Why are there 5 pools? Per your snmp xml script, there should only be 1.
There are 5 memory pools - each row in the query is a different pool. I had thought I had to create a new Data Source Item, one per query row index, in order to graph all returned rows on a single graph.

If that is not the case, would I merely use a single Data Source item, and still be able to do what I want?

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

Post by BSOD2600 »

tbessie wrote:There are 5 memory pools - each row in the query is a different pool. I had thought I had to create a new Data Source Item, one per query row index, in order to graph all returned rows on a single graph.
Wrong. You're not thinking abstract enough. Each Data Source for a device should represent a unique entry on some device.
tbessie wrote:If that is not the case, would I merely use a single Data Source item, and still be able to do what I want?
Yes. Same way the snmp interface query functions. Each index is its own data source and graph. Same with yours. Each pool will have its own data source and graph. Then, once each pool # is being graphed, you can create a custom graph (either manually or with aggregate plugin) which combines them all.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:
tbessie wrote:There are 5 memory pools - each row in the query is a different pool. I had thought I had to create a new Data Source Item, one per query row index, in order to graph all returned rows on a single graph.
Wrong. You're not thinking abstract enough. Each Data Source for a device should represent a unique entry on some device.
tbessie wrote:If that is not the case, would I merely use a single Data Source item, and still be able to do what I want?
Yes. Same way the snmp interface query functions. Each index is its own data source and graph. Same with yours. Each pool will have its own data source and graph. Then, once each pool # is being graphed, you can create a custom graph (either manually or with aggregate plugin) which combines them all.
Well, I did it the way you describe. Now I no longer get 25 entries, I get just the 5. And I created a single graph with one line per datasource, plus a Legend for each.

HOWEVER... *now* it is getting the same value for all 5 datasources, even though the "name" value (taken from each row in the SNMP query) is correct for each index.

For this, I ought to have just *one* data template, correct? Not a separate data template per datasource, with index given, right? Because the created datasources have the correct index, but the graph only gives me the datasource template's name to choose from for each graph item.

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

Post by BSOD2600 »

tbessie wrote:HOWEVER... *now* it is getting the same value for all 5 datasources, even though the "name" value (taken from each row in the SNMP query) is correct for each index.
Post the verbose query of this script for that device. Sounds like you're not using the correct index. you can change the cacti logging level to debug and then monitor what values are returned for your script and their rrd files updated.
tbessie wrote:For this, I ought to have just *one* data template, correct? Not a separate data template per datasource, with index given, right?
Correct.
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:Post the verbose query of this script for that device. Sounds like you're not using the correct index. you can change the cacti logging level to debug and then monitor what values are returned for your script and their rrd files updated.
tbessie wrote:For this, I ought to have just *one* data template, correct? Not a separate data template per datasource, with index given, right?
Correct.
Here you go. Let me know if you see anything unusual. I'm taking the "Name" value and using the final integer in the OID for my index value, as given as an example on this website:

Code: Select all

+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2'
+ Inserting index data [value='1']
+ Inserting index data [value='2']
+ Inserting index data [value='3']
+ Inserting index data [value='4']
+ Inserting index data [value='5']
+ Located input field 'jvmMemPoolName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.2'
+ Found item [jvmMemPoolName='Code Cache'] index: 1 [from value]
+ Found item [jvmMemPoolName='Par Eden Space'] index: 2 [from value]
+ Found item [jvmMemPoolName='Par Survivor Space'] index: 3 [from value]
+ Found item [jvmMemPoolName='CMS Old Gen'] index: 4 [from value]
+ Found item [jvmMemPoolName='CMS Perm Gen'] index: 5 [from value]
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/jvmMemoryPoolsUsed.xml'
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

All looks good there. yes, you do want to use the name to track the index in case the number changes.

Back to the duplicate graph issue. Clear the poller cache. Then look in there for your script entries. The snmp indexes are correct and unique?
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Post by tbessie »

BSOD2600 wrote:All looks good there. yes, you do want to use the name to track the index in case the number changes.

Back to the duplicate graph issue. Clear the poller cache. Then look in there for your script entries. The snmp indexes are correct and unique?
Just tried that... everything looks the way it's supposed to be; yet the graph shows a single value still. No joy. :-(

Here's what the cache clearing page showed; I used snmpwalk/snmpget on those OIDs, and they all have different values. Image of currently graphed data below as well. Perhaps there's something braindead I've done in all this, tho' I feel I've tried everything:

Code: Select all

emdlcis01 - jvm - memPoolUsed - 1 - Code Cache   	 SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.1
	RRD: /var/www/cacti/rra/emdlcis01_usedmem_2006.rrd
emdlcis01 - jvm - memPoolUsed - 2 - Par Eden Space 	SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.2
	RRD: /var/www/cacti/rra/emdlcis01_usedmem_2007.rrd
emdlcis01 - jvm - memPoolUsed - 3 - Par Survivor Sp 	SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.3
	RRD: /var/www/cacti/rra/emdlcis01_usedmem_2008.rrd
emdlcis01 - jvm - memPoolUsed - 4 - CMS Old Gen 	SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.4
	RRD: /var/www/cacti/rra/emdlcis01_usedmem_2009.rrd
emdlcis01 - jvm - memPoolUsed - 5 - CMS Perm Gen 	SNMP Version: 2, Community: public, OID: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.5
	RRD: /var/www/cacti/rra/emdlcis01_usedmem_2010.rrd
Attachments
memPools.png
memPools.png (34.68 KiB) Viewed 2715 times
tbessie
Posts: 36
Joined: Fri May 15, 2009 3:43 pm

Further info

Post by tbessie »

Here's Spine's output, followed by snmpget's output of the same OIDs. Why would spline think the values are all the same as the 1st one it gets? Does the fact that the dsname is the same for all values have anything to do with it?

SPINE OUTPUT

Code: Select all

05/29/2009 05:37:21 PM - SPINE: Poller[0] Host[86] DS[2136] SNMP: v2: emqlcis01, dsname: usedMem, oid: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.1, value: 8121984

05/29/2009 05:37:21 PM - SPINE: Poller[0] Host[86] DS[2137] SNMP: v2: emqlcis01, dsname: usedMem, oid: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.2, value: 8121984

05/29/2009 05:37:21 PM - SPINE: Poller[0] Host[86] DS[2138] SNMP: v2: emqlcis01, dsname: usedMem, oid: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.3, value: 8121984

05/29/2009 05:37:21 PM - SPINE: Poller[0] Host[86] DS[2139] SNMP: v2: emqlcis01, dsname: usedMem, oid: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.4, value: 8121984

05/29/2009 05:37:21 PM - SPINE: Poller[0] Host[86] DS[2140] SNMP: v2: emqlcis01, dsname: usedMem, oid: .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.5, value: 8121984
SNMPGET OUTPUT

Code: Select all

snmpget -v 2c -m JVM-MANAGEMENT-MIB -c public emqlcis01:5161 .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.1
JVM-MANAGEMENT-MIB::jvmMemPoolUsed.1 = Counter64: 8228224 bytes

snmpget -v 2c -m JVM-MANAGEMENT-MIB -c public emqlcis01:5161 .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.2
JVM-MANAGEMENT-MIB::jvmMemPoolUsed.2 = Counter64: 9840904 bytes

snmpget -v 2c -m JVM-MANAGEMENT-MIB -c public emqlcis01:5161 .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.3
JVM-MANAGEMENT-MIB::jvmMemPoolUsed.3 = Counter64: 0 bytes

snmpget -v 2c -m JVM-MANAGEMENT-MIB -c public emqlcis01:5161 .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.4
JVM-MANAGEMENT-MIB::jvmMemPoolUsed.4 = Counter64: 111344064 bytes

snmpget -v 2c -m JVM-MANAGEMENT-MIB -c public emqlcis01:5161 .1.3.6.1.4.1.42.2.145.3.163.1.1.2.110.1.11.5
JVM-MANAGEMENT-MIB::jvmMemPoolUsed.5 = Counter64: 49598600 bytes
- Tim
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests