Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

snmp OID not increasing

Tags:

snmp

oid

I try to create a custom SNMP oid (and script).

I add the following line to snmpd.conf (and restart service) :

pass .1.3.6.1.3.2 /bin/myscript.sh

.

cat myscript.sh
#!/bin/sh
echo .1.3.6.1.3.2
echo gauge
exec 100

.

snmpwalk -c mycommunity -v2c 10.2.1.4 .1.3.6.1.3.2
SNMPv2-SMI::experimental.2 = Gauge32: 100
Error: OID not increasing: SNMPv2-SMI::experimental.2
>= SNMPv2-SMI::experimental.2

Is snmpwalk expecting anything at the end of the query ? snmpget work with no problem!

like image 309
amprantino Avatar asked Sep 07 '25 19:09

amprantino


2 Answers

By default snmpwalk expect the value to be increasing. To get around it try:

snmpwalk -Cc -c mycommunity -v2c 10.2.1.4 .1.3.6.1.3.2

The Cc option does this: "do not check returned OIDs are increasing"

Often the walk can be completed with oid:s out of order using this.

like image 136
SpacemanSpiff Avatar answered Sep 10 '25 05:09

SpacemanSpiff


snmpwalk expects increasing replies :

SNMPv2-SMI::experimental.2 = Gauge32: 100
SNMPv2-SMI::experimental.3 = Gauge32: 1125
SNMPv2-SMI::other.1 = Gauge32: 10
END

It appears that the snmp agent replies two identical values :

SNMPv2-SMI::experimental.2 = Gauge32: 100
SNMPv2-SMI::experimental.2 = Gauge32: 100

So it fails (unexpected behaviour).

like image 33
JB. Avatar answered Sep 10 '25 04:09

JB.