SNMP Query XML problem: method get instead walk.

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

Moderators: Developers, Moderators

Post Reply
alksf
Posts: 3
Joined: Tue Apr 29, 2014 5:46 am

SNMP Query XML problem: method get instead walk.

Post by alksf »

Hi,
Cacti 8.8b.
I have this xml query:

Code: Select all

<interface>
  <name>Get E1 trunks</name>
  <description>E1 trunks information</description>
  <index_order_type>numeric</index_order_type>
  <oid_index>.1.3.6.1.4.1.35265.1.29.7.1.2</oid_index>
  <oid_index_parse>OID/REGEXP:.*\.(..?)$</oid_index_parse>
  <fields>
	  <E1Index>
	    <name>Index</name>
	    <source>index</source>
	    <method>walk</method>
	    <direction>input</direction>
	  </E1Index>
    <E1Utilization>
	    <name>BusyChannels</name>
	    <method>walk</method>
	    <source>value</source>
	    <direction>output</direction>
	     <oid>.1.3.6.1.4.1.35265.1.29.31.1</oid>
	  </E1Utilization>
  </fields>
</interface>
But there is a problem with getting E1Utilization: Cacti uses method get instead walk to retrieve values

Code: Select all

14:41:04.031704  1.1.1.1.36543 > 2.2.2.2.161:  { SNMPv2c C=secret { GetRequest(33) R=736214646  .1.3.6.1.4.1.35265.1.29.31.1.2 } } 
14:41:04.074773  2.2.2.2.161 > 1.1.1.1.36543:  { SNMPv2c C=secret { GetResponse(33) R=736214646  .1.3.6.1.4.1.35265.1.29.31.1.2=[noSuchInstance] } } 
It's cuz E1Utilization value not exactly in 1.3.6.1.4.1.35265.1.29.31.1 OID, it's in 1.3.6.1.4.1.35265.1.29.31.1.index.0 OID.
Any advice to solve this problem?
alksf
Posts: 3
Joined: Tue Apr 29, 2014 5:46 am

Re: SNMP Query XML problem: method get instead walk.

Post by alksf »

I will try to explain my problem again:
I build indexes from OID 1.3.6.1.4.1.35265.1.29.7.1.2 with oid_index_parse OID/REGEXP:.*\.(..?)$

Code: Select all

$ snmpwalk -v 2c -c secret 1.1.1.1 1.3.6.1.4.1.35265.1.29.7.1.2
SNMPv2-SMI::enterprises.35265.1.29.7.1.2.0 = INTEGER: 6
SNMPv2-SMI::enterprises.35265.1.29.7.1.2.1 = INTEGER: 0
SNMPv2-SMI::enterprises.35265.1.29.7.1.2.2 = INTEGER: 6
...
SNMPv2-SMI::enterprises.35265.1.29.7.1.2.15 = INTEGER: 0
so my indexes are 0-15

Now i have problem with geting data for indexes to make graphs: data stores in OIDs like 1.3.6.1.4.1.35265.1.29.31.1.index.0
I can get data with snmpwalk and not with snpmget:

Code: Select all

$ snmpwalk -v 2c -c secret 1.1.1.1 1.3.6.1.4.1.35265.1.29.31.1.0
SNMPv2-SMI::enterprises.35265.1.29.31.1.0.0 = Counter32: 9
$ snmpget -v 2c -c secret 1.1.1.1 1.3.6.1.4.1.35265.1.29.31.1.0
SNMPv2-SMI::enterprises.35265.1.29.31.1.0 = No Such Instance currently exists at this OID
I'm using method walk in my XML query file, but in tcpdump i see responses like "SNMPv2-SMI::enterprises.35265.1.29.31.1.0 = No Such Instance currently exists at this OID". How can i change XML file or somewhere in Cacti to query OID like 1.3.6.1.4.1.35265.1.29.31.1.index.0?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: SNMP Query XML problem: method get instead walk.

Post by BSOD2600 »

Are you sure the indexes for those two OIDs can be shared between 1.1.1.1 1.3.6.1.4.1.35265.1.29.7.1.2 and 1.1.1.1 1.3.6.1.4.1.35265.1.29.31.1.0? I would've expected the first query to output the index.0, but it doesnt appear to do so.

Maybe have cacti build the index using 1.1.1.1 1.3.6.1.4.1.35265.1.29.31 and update the regex to use both touples of the OID so Cacti ends up with:
1.0
2.0
3.0
etc
alksf
Posts: 3
Joined: Tue Apr 29, 2014 5:46 am

Re: SNMP Query XML problem: method get instead walk.

Post by alksf »

BSOD2600 wrote: Maybe have cacti build the index using 1.1.1.1 1.3.6.1.4.1.35265.1.29.31 and update the regex to use both touples of the OID so Cacti ends up with:
1.0
2.0
3.0
etc
Tnx for advice. Looks a bit dirty, but it works, tnx again!
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests