snmp query problem (custom data query)

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

Moderators: Developers, Moderators

Post Reply
kejsix
Posts: 5
Joined: Fri Jan 25, 2013 8:26 am

snmp query problem (custom data query)

Post by kejsix »

Hi,

Few hour i´m trying to solve this problem (for me)... I´ve made this .xml snmp_query template (based on other template)

Code: Select all

<interface>
	<name>Nec NEO Rx/Tx Levels</name>
	<description>Queries pre Rx/Tx levels</description>
	<oid_index>.1.3.6.1.4.1.119.2.3.69.401.8.1.1</oid_index>
	<index_order_type>numeric</index_order_type>

	<fields>
		<rxLevel>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.119.2.3.69.401.8.1.1.3</oid>
		</rxLevel>
		<txLevel>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.4.1.119.2.3.69.401.8.1.1.5</oid>
		</txLevel>
	</fields>
</interface>
Exactly what I need is to query OIDs ".1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.1" and ".1.3.6.1.4.1.119.2.3.69.401.8.1.1.5.1", but with ".1" at the end script returns no data. If remov the ".1" from script, then after Verbose Query i get this:

Code: Select all

+ Running data query [15].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.1.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.1.2' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.2.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.2.2' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.1' value: '+08.9'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.2' value: '#####'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.4.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.4.2' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.5.1' value: '-46.7'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.5.2' value: '#####'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.6.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.6.2' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.7.1' value: '-53'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.7.2' value: '###'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.8.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.8.2' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.9.1' value: '+03.1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.9.2' value: '#####'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.10.1' value: '2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.10.2' value: '1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.11.1' value: '+28.2'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.11.2' value: '#####'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.12.1' value: '127'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.12.2' value: '127'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.13.1' value: '0'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.13.2' value: '-1'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.14.1' value: '8'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.14.2' value: '-1'
+ Located input field 'rxLevel' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1.3'
+ Found item [rxLevel='+08.9'] index: 1 [from value]
+ Found item [rxLevel='#####'] index: 2 [from value]
+ Located input field 'txLevel' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1.5'
+ Found item [txLevel='-46.7'] index: 1 [from value]
+ Found item [txLevel='#####'] index: 2 [from value]
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
So it returns 4 values (including that '#####'). How can i filter this and get only values at indes: 1 for both of the OIDs?

Thanks a lot
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: snmp query problem (custom data query)

Post by gandalf »

In case you need to query a single OID only, please use the "Generic OID template".
Or use a script that snmpget's waht you need.

Using the Data Query approach, you'll have to pay attention to "<oid_index>.1.3.6.1.4.1.119.2.3.69.401.8.1.1</oid_index>". In your example, this will NOT return a single numeric as an index!
"<oid_index>.1.3.6.1.4.1.119.2.3.69.401.8.1.1.3</oid_index>" might work better.

See walkthrough at 1st link of my sig for more explanations
R.
kejsix
Posts: 5
Joined: Fri Jan 25, 2013 8:26 am

Re: snmp query problem (custom data query)

Post by kejsix »

I need to query 3 OIDs - that´s the reason, why I think it´s better to use snmp_query template.

I´ve corrected that <oid_index> value. But still need filter item with ##### for each OID - need return only values at index: 1.

Code: Select all

+ Running data query [15].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1.3'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.1' value: '+09.0'
+ Index found at OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.2' value: '#####'
+ Located input field 'rxLevel' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1.3'
+ Found item [rxLevel='+09.0'] index: 1 [from value]
+ Found item [rxLevel='#####'] index: 2 [from value]
+ Located input field 'txLevel' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.119.2.3.69.401.8.1.1.5'
+ Found item [txLevel='-47.5'] index: 1 [from value]
+ Found item [txLevel='#####'] index: 2 [from value]
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/snmp_queries/nec_neo.xml'
And yes, I´ve spended many hours reading many articles incl. walkthrough. But I´m still a quite new to this and it´s a too much info for me at this time (specially, if not a "coder" ) ;).
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: snmp query problem (custom data query)

Post by gandalf »

IMHO there's a fundamental misunderstanding regarding SNMP Data Queries.

Yes, the _usually_ will return more than one index (a table consisting of one line only is a weird table).
And yes, you _usually_ will select those lines only, that you are interested in. In this case, you will select the line related to index value 1.

So all I can see now, is that the Data Query is working well.

You may ask now: Where will I select the index I need? Well, when "Creating Graphs fro this Host", you will be presented with the full table and select the line that you need, only. This will allow you to create e.g. a temperature graph (evaluating the OID: '1.3.6.1.4.1.119.2.3.69.401.8.1.1.3.1') and a traffic graph, using the other two items.
So you will have to create two graphs and associate both with this Data Query. All should be explained step by step by my walkthroughs
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests