Page 1 of 1

net-snmp-config --default-mibdirs

Posted: Fri Feb 23, 2018 11:50 am
by btgnrw
My environment has the following default MIB directory:

[root@NAGIOS snmp]# net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/local/share/snmp/mibs

When running snmptranslate -Tz -m /usr/share/snmp/mibs/F5-BIGIP-LOCAL-MIB.txt it returns the following error code:

Code: Select all

Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatServerMaxConns ::= { ltmTransAddrStatEntry 7 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatServerBytesOut ::= { ltmTransAddrStatEntry 6 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatServerPktsOut ::= { ltmTransAddrStatEntry 5 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatServerBytesIn ::= { ltmTransAddrStatEntry 4 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatServerPktsIn ::= { ltmTransAddrStatEntry 3 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatAddr ::= { ltmTransAddrStatEntry 2 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmTransAddrStatAddrType ::= { ltmTransAddrStatEntry 1 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmVirtualServRulePriority ::= { ltmVirtualServRuleEntry 3 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmVirtualServRuleRuleName ::= { ltmVirtualServRuleEntry 2 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmVirtualServRuleVirtualServerName ::= { ltmVirtualServRuleEntry 1 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmAuthProfileStat ::= { ltmAuth 2 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmAuthProfile ::= { ltmAuth 1 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmRateFilterTable ::= { ltmRateFilter 2 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmRateFilterNumber ::= { ltmRateFilter 1 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmPoolMemberTable ::= { ltmPoolMember 2 }
Cannot adopt OID in F5-BIGIP-LOCAL-MIB: ltmPoolMemberNumber ::= { ltmPoolMember 1 }
For all the OID descriptions in the MIB.

Whereas if I specify the correct MIB directory and run:
snmptranslate -Tz -m /usr/share/snmp/mibs/F5-BIGIP-LOCAL-MIB.txt -M /usr/share/snmp/mibs

The top level OIDs are returned for each MIB:

Code: Select all

[root@NAGIOS snmp]# snmptranslate -Tz -m /usr/share/snmp/mibs/F5-BIGIP-LOCAL-MIB.txt -M /usr/share/snmp/mibs
"org"                   "1.3"
"dod"                   "1.3.6"
"internet"                      "1.3.6.1"
"directory"                     "1.3.6.1.1"
"mgmt"                  "1.3.6.1.2"
"mib-2"                 "1.3.6.1.2.1"
"transmission"                  "1.3.6.1.2.1.10"
"inetAddressMIB"                        "1.3.6.1.2.1.76"
"hcnumTC"                       "1.3.6.1.2.1.78"
"experimental"                  "1.3.6.1.3"
"private"                       "1.3.6.1.4"
"enterprises"                   "1.3.6.1.4.1"
"f5"                    "1.3.6.1.4.1.3375"
"bigipTrafficMgmt"                      "1.3.6.1.4.1.3375.2"
"bigipLocalTM"                  "1.3.6.1.4.1.3375.2.2"
"ltmGlobals"                    "1.3.6.1.4.1.3375.2.2.1"
"ltmGlobalAttr"                 "1.3.6.1.4.1.3375.2.2.1.1"
"ltmAttrLbmodeFastestMaxIdleTime"                       "1.3.6.1.4.1.3375.2.2.1.1.1"
"ltmAttrMirrorState"                    "1.3.6.1.4.1.3375.2.2.1.1.2"
"ltmAttrPersistDestAddrLimitMode"                       "1.3.6.1.4.1.3375.2.2.1.1.3"
"ltmAttrPersistDestAddrMaxCount"                        "1.3.6.1.4.1.3375.2.2.1.1.4"
"ltmAttrSnatAnyIpProtocol"                      "1.3.6.1.4.1.3375.2.2.1.1.5"
"ltmAttrMirrorPeerIpAddr"                       "1.3.6.1.4.1.3375.2.2.1.1.6"
"ltmMirrors"                    "1.3.6.1.4.1.3375.2.2.2"
"ltmMirrorPort"                 "1.3.6.1.4.1.3375.2.2.2.1"
"ltmMirrorPortNumber"                   "1.3.6.1.4.1.3375.2.2.2.1.1"
"ltmMirrorPortTable"                    "1.3.6.1.4.1.3375.2.2.2.1.2"
"ltmMirrorPortEntry"                    "1.3.6.1.4.1.3375.2.2.2.1.2.1"
"ltmMirrorPortName"                     "1.3.6.1.4.1.3375.2.2.2.1.2.1.1"
"ltmMirrorPortMember"                   "1.3.6.1.4.1.3375.2.2.2.2"
"ltmMirrorPortMemberNumber"                     "1.3.6.1.4.1.3375.2.2.2.2.1"
"ltmMirrorPortMemberTable"                      "1.3.6.1.4.1.3375.2.2.2.2.2"
"ltmMirrorPortMemberEntry"                      "1.3.6.1.4.1.3375.2.2.2.2.2.1"
"ltmMirrorPortMemberToName"                     "1.3.6.1.4.1.3375.2.2.2.2.2.1.1"
"ltmMirrorPortMemberName"                       "1.3.6.1.4.1.3375.2.2.2.2.2.1.2"
"ltmMirrorPortMemberConduitName"                        "1.3.6.1.4.1.3375.2.2.2.2.2.1.3"
This is causing problems when adding check_xi_service_snmp using the snmp walk wizard and specifying a top-level OID by name ltmVirtualServStatus instead of OID 1.3.6.1.4.1.3375.2.2.10.13.2.1.2.

Using the OID name returns the OID names in the walk but once the checks have been added the following error is seen for -p 161 -o ltmVsStatusName."/Common/virtualservername" -P 3 --seclevel=authPriv --secname=name --authproto=MD5 --authpasswd='password' --privpasswd='password' -x des -m F5-BIGIP-LOCAL-MIB:

External command error: ltmVsStatusName./Common/virtualservername: Unknown Object Identifier (Index out of range: /Common/virtualservername (ltmVsStatusName))

Using the OID works:
-p 161 -o ltmVsStatusAvailState.30.47.67.111.109.109.111.110.47.115.117.110.100.95.103.101.110.101.115.121.115.95.118.112.115.118.114.95.118.105.112 -P 3 --seclevel=authPriv --secname=name --authproto=MD5 --authpasswd='password' --privpasswd='password' -x des -m F5-BIGIP-LOCAL-MIB

Is there a way to change the default MIB DIR?

Re: net-snmp-config --default-mibdirs

Posted: Fri Feb 23, 2018 1:26 pm
by swolf
Hi btgnrw,

We won't be able to change the default mibdirs directly (documentation seems to indicate that these options are compiled/not configurable), but we can do something equivalent.

First, run the following command:

Code: Select all

net-snmp-config --snmpconfpath
In any of these directories, create a file called snmp.conf.

In your snmp.conf file, you'll want to add the following line:

Code: Select all

mibdirs /usr/share/snmp/mibs/
This is the equivalent of setting "-M /usr/share/snmp/mibs/" on all of your net-snmp commands.

Re: net-snmp-config --default-mibdirs

Posted: Mon Feb 26, 2018 6:59 am
by btgnrw
Thanks snmptranslate now returns the OIDs. I had created the snmp.conf file but it was not placed in the snmpconfpath.

Unfortunately when I perform an snmpwalk from within XI the OIDs are found on the F5 Big IP device by OID name; add them as services and the following error status is returned:

ltmVsStatusAvailState._/Common/vipname

Unknown 3h 37m 58s 5/5 26/02/2018 11:34:17 External command error: ltmVsStatusAvailState./Common/vipname: Unknown Object Identifier (Index out of range: /Common/vipname (ltmVsStatusName))

In order for me to get the xi_service_check_snmp to return the OID status I have to use a 3rd party MIB browser to identify the full OID and then copy and paste after the top level name ltmVsStatusAvailState e.g.:

Code: Select all

-p 161 -o ltmVsStatusAvailState.49.47.67.111.109.109.111.110.47.110.112.45.118.105.112.45.103.97.120.46.112.115.110.99.99.46.103.112.110.46.103.111.118.46.117.107.95.76.49.95.83.101.114.118.105.99.101.95.118.115 -P 3 --seclevel=authPriv --secname=name --authproto=MD5 --authpasswd='password' --privpasswd='password' -x des -m F5-BIGIP-LOCAL-MIB -w 4 -c 3
There must be a better way of doing this?

Re: net-snmp-config --default-mibdirs

Posted: Mon Feb 26, 2018 5:30 pm
by tgriep
It sound like the MIB file that those OID's are from could be corrupted or in the wrong format.

Check the mib files in this folder /usr/share/snmp/mibs/ to see if they are formatted correctly.
Also, check to see if all of the MIB files are installed on the Nagios server as some MIB files include information from other MIB file and that could cause the issue as well.