社員ブログ

snmpwalkコマンド実行時のエラーの減らし方

ZabbixのSNMPエージェントを使ったアイテムを追加時は事前にsnmpwalkコマンドで事前に監視アイテムの応答の値を調べてから決めることが非常に多いかと思います。その際、MIBの依存関係の兼ね合いで足りてないMIBファイルによるエラーが出ることが往々にしてあります。その際の解消方法をご紹介します。

root@ZABBIX mibs]# snmpwalk -v 2c -c community-name 192.168.1.1 private | more
MIB search path: /usr/share/snmp/mibs:/usr/share/snmp/vendormibs
Cannot find module (ENTITY-MIB): At line 18 in /usr/share/snmp/vendormibs/PAN-ENTITY-EXT-MIB.my
Did not find 'entPhysicalIndex' in module #-1 (/usr/share/snmp/vendormibs/PAN-ENTITY-EXT-MIB.my)
Cannot find module (TOKEN-RING-RMON-MIB): At line 18 in /usr/share/snmp/mibs/RMON2-MIB.txt
Did not find 'tokenRing' in module #-1 (/usr/share/snmp/mibs/RMON2-MIB.txt)
Did not find 'tokenRingMLStatsEntry' in module #-1 (/usr/share/snmp/mibs/RMON2-MIB.txt)
Did not find 'tokenRingPStatsEntry' in module #-1 (/usr/share/snmp/mibs/RMON2-MIB.txt)
Did not find 'ringStationControlEntry' in module #-1 (/usr/share/snmp/mibs/RMON2-MIB.txt)
Did not find 'sourceRoutingStatsEntry' in module #-1 (/usr/share/snmp/mibs/RMON2-MIB.txt)
Unlinked OID in RMON2-MIB: sourceRoutingStats2Table ::= {​​​​​​​​ tokenRing 8 }​​​​​​​​
Undefined identifier: tokenRing near line 5581 of /usr/share/snmp/mibs/RMON2-MIB.txt
Unlinked OID in RMON2-MIB: ringStationControl2Table ::= {​​​​​​​​ tokenRing 7 }​​​​​​​​
Undefined identifier: tokenRing near line 5519 of /usr/share/snmp/mibs/RMON2-MIB.txt
Cannot adopt OID in RMON2-MIB: sourceRoutingStats2Entry ::= {​​​​​​​​ sourceRoutingStats2Table 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControlCreateTime ::= {​​​​​​​​ ringStationControl2Entry 2 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControlDroppedFrames ::= {​​​​​​​​ ringStationControl2Entry 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStatsCreateTime ::= {​​​​​​​​ sourceRoutingStats2Entry 2 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStatsDroppedFrames ::= {​​​​​​​​ sourceRoutingStats2Entry 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControl2Table ::= {​​​​​​​​ tokenRing 7 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStats2Table ::= {​​​​​​​​ tokenRing 8 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControl2Entry ::= {​​​​​​​​ ringStationControl2Table 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStats2Entry ::= {​​​​​​​​ sourceRoutingStats2Table 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControlDroppedFrames ::= {​​​​​​​​ ringStationControl2Entry 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControlCreateTime ::= {​​​​​​​​ ringStationControl2Entry 2 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStatsDroppedFrames ::= {​​​​​​​​ sourceRoutingStats2Entry 1 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStatsCreateTime ::= {​​​​​​​​ sourceRoutingStats2Entry 2 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: sourceRoutingStats2Table ::= {​​​​​​​​ tokenRing 8 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControl2Table ::= {​​​​​​​​ tokenRing 7 }​​​​​​​​
Cannot adopt OID in RMON2-MIB: ringStationControl2Entry ::= {​​​​​​​​ ringStationControl2Table 1 }​​​​​​​​

snmpwalkがエラー吐く時って大体こんな感じのエラーになります。オレンジの行のMIBを持ってくればOKです。
http://www.circitor.fr/Mibs/Html/E/ENTITY-MIB.php
このページの一番上の方にファイルの直リンクがあるからwgetコマンドでそれぞれ足りないファイルをmibのディレクトリに放り込んだら大体改善されます。
( ) の中のMIBが必要なMIBとなります。この場合は

ENTITY-MIB
TOKEN-RING-RMON-MIB

です。ご参考までに。

関連記事

TOP