PDA

View Full Version : Aide pour mib


seb974
07-20-2007, 09:36 AM
Bonjour !

Je voudrais faire un check_graph_traffic sur une interface spécifique. Je lance donc la commande pour avoir les numéros d'interface :

./check_graph_traffic.pl -H 192.168.1.254 -C azqswx -s
Interface 1 :: FastEthernet0
Interface 2 :: FastEthernet1
Interface 3 :: FastEthernet2
Interface 4 :: FastEthernet3
Interface 5 :: Dot11Radio0
Interface 6 :: ATM0
Interface 7 :: Null0
Interface 8 :: ATM0-atm layer
Interface 9 :: ATM0.0-atm subif
Interface 10 :: ATM0-aal5 layer
Interface 11 :: ATM0.0-aal5 layer
Interface 12 :: ATM0-adsl
Interface 13 :: Vlan1
Interface 14 :: ATM0.1-atm subif
Interface 15 :: ATM0.1-aal5 layer
Interface 16 :: Dialer0
Interface 17 :: BVI1
Interface 18 :: Virtual-Dot11Radio0
Interface 19 :: Virtual-Access1

Mais j'ai remarqué que si je faisais un check sur l'interface 0 (qui n'existe pas a priori), j'avais un quand même une réponse :

./check_graph_traffic.pl -H 192.168.1.254 -C azqswx -i 0
Traffic In : 22.96 kb/s (0.0 %), Out : 28.44 kb/s (0.0 %) - Total RX Bits In : 1.14 GB, Out : 1.81 Gb|traffic_in=22959,3Bits/s traffic_out=28443,9Bits/s

Le 0 correspond à l'interface 2 apparement, car quand je fais avec 2 j'ai la même chose oO.

Et quand je fais :

./check_graph_traffic.pl -H 192.168.1.254 -C azqswx -v 1 -i 12
ERROR: IN Bits : Received noSuchName(2) error-status at error-index 1.

Je me retourne donc vers le MIB, puisque cela semble être la seule solution ?

Je fais un snmpwalk sur mon routeur :


...
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifIndex.5 = INTEGER: 5
IF-MIB::ifIndex.6 = INTEGER: 6
IF-MIB::ifIndex.7 = INTEGER: 7
IF-MIB::ifIndex.8 = INTEGER: 8
IF-MIB::ifIndex.9 = INTEGER: 9
IF-MIB::ifIndex.10 = INTEGER: 10
IF-MIB::ifIndex.11 = INTEGER: 11
IF-MIB::ifIndex.12 = INTEGER: 12
IF-MIB::ifIndex.13 = INTEGER: 13
IF-MIB::ifIndex.14 = INTEGER: 14
IF-MIB::ifIndex.15 = INTEGER: 15
IF-MIB::ifIndex.16 = INTEGER: 16
IF-MIB::ifIndex.17 = INTEGER: 17
IF-MIB::ifIndex.18 = INTEGER: 18
IF-MIB::ifIndex.19 = INTEGER: 19
IF-MIB::ifDescr.1 = STRING: FastEthernet0
IF-MIB::ifDescr.2 = STRING: FastEthernet1
IF-MIB::ifDescr.3 = STRING: FastEthernet2
IF-MIB::ifDescr.4 = STRING: FastEthernet3
IF-MIB::ifDescr.5 = STRING: Dot11Radio0
IF-MIB::ifDescr.6 = STRING: ATM0
IF-MIB::ifDescr.7 = STRING: Null0
IF-MIB::ifDescr.8 = STRING: ATM0-atm layer
IF-MIB::ifDescr.9 = STRING: ATM0.0-atm subif
IF-MIB::ifDescr.10 = STRING: ATM0-aal5 layer
IF-MIB::ifDescr.11 = STRING: ATM0.0-aal5 layer
IF-MIB::ifDescr.12 = STRING: ATM0-adsl
IF-MIB::ifDescr.13 = STRING: Vlan1
IF-MIB::ifDescr.14 = STRING: ATM0.1-atm subif
IF-MIB::ifDescr.15 = STRING: ATM0.1-aal5 layer
IF-MIB::ifDescr.16 = STRING: Dialer0
IF-MIB::ifDescr.17 = STRING: BVI1
IF-MIB::ifDescr.18 = STRING: Virtual-Dot11Radio0
IF-MIB::ifDescr.19 = STRING: Virtual-Access1
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.5 = INTEGER: ieee80211(71)
IF-MIB::ifType.6 = INTEGER: adsl(94)
IF-MIB::ifType.7 = INTEGER: other(1)
IF-MIB::ifType.8 = INTEGER: atm(37)
IF-MIB::ifType.9 = INTEGER: atmSubInterface(134)
IF-MIB::ifType.10 = INTEGER: aal5(49)
IF-MIB::ifType.11 = INTEGER: aal5(49)
IF-MIB::ifType.12 = INTEGER: adsl(94)
IF-MIB::ifType.13 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.14 = INTEGER: atmSubInterface(134)
IF-MIB::ifType.15 = INTEGER: aal5(49)
IF-MIB::ifType.16 = INTEGER: ppp(23)
IF-MIB::ifType.17 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.18 = INTEGER: ieee80211(71)
IF-MIB::ifType.19 = INTEGER: ppp(23)
...
SNMPv2-SMI::mib-2.47.1.1.1.1.2.2 = STRING: "Fast Ethernet"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.3 = STRING: "Fast Ethernet"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.4 = STRING: "Fast Ethernet"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.5 = STRING: "Fast Ethernet"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.6 = STRING: "Radio ATHEROS AR5213:"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.7 = STRING: "MPC ATMSAR (with Alcatel ADSL Module)"
SNMPv2-SMI::mib-2.47.1.1.1.1.2.8 = STRING: "ATM0-adsl"
SNMPv2-SMI::mib-2.47.1.1.1.1.3.1 = OID: SNMPv2-SMI::enterprises.9.12.3.1.3.432
SNMPv2-SMI::mib-2.47.1.1.1.1.3.2 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.69
SNMPv2-SMI::mib-2.47.1.1.1.1.3.3 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.69
SNMPv2-SMI::mib-2.47.1.1.1.1.3.4 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.69
SNMPv2-SMI::mib-2.47.1.1.1.1.3.5 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.69
SNMPv2-SMI::mib-2.47.1.1.1.1.3.6 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.1
SNMPv2-SMI::mib-2.47.1.1.1.1.3.7 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.157
SNMPv2-SMI::mib-2.47.1.1.1.1.3.8 = OID: SNMPv2-SMI::enterprises.9.12.3.1.10.1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.1 = INTEGER: 0
SNMPv2-SMI::mib-2.47.1.1.1.1.4.2 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.3 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.4 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.5 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.6 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.7 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.4.8 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.5.1 = INTEGER: 9
SNMPv2-SMI::mib-2.47.1.1.1.1.5.2 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.3 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.4 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.5 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.6 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.7 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.5.8 = INTEGER: 10
SNMPv2-SMI::mib-2.47.1.1.1.1.6.1 = INTEGER: -1
SNMPv2-SMI::mib-2.47.1.1.1.1.6.2 = INTEGER: 0
SNMPv2-SMI::mib-2.47.1.1.1.1.6.3 = INTEGER: 1
SNMPv2-SMI::mib-2.47.1.1.1.1.6.4 = INTEGER: 2
SNMPv2-SMI::mib-2.47.1.1.1.1.6.5 = INTEGER: 3
SNMPv2-SMI::mib-2.47.1.1.1.1.6.6 = INTEGER: 4
SNMPv2-SMI::mib-2.47.1.1.1.1.6.7 = INTEGER: 5
SNMPv2-SMI::mib-2.47.1.1.1.1.6.8 = INTEGER: 12
SNMPv2-SMI::mib-2.47.1.1.1.1.7.1 = STRING: "877W"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.2 = STRING: "FastEthernet0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.3 = STRING: "FastEthernet1"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.4 = STRING: "FastEthernet2"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.5 = STRING: "FastEthernet3"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.6 = STRING: "Dot11Radio0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.7 = STRING: "ATM0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.8 = STRING: "AT0-adsl"
SNMPv2-SMI::mib-2.47.1.1.1.1.8.1 = STRING: "V02 "


J'aimerais avoir l'OID de l'interface : ATM0 et ATMO-adsl ainsi que la façon que je dois l'entrer dans la commande ./check_graph_traffic svp.

Merci d'avance pour vos réponses ! :)

WAtt
07-20-2007, 11:22 AM
Salut mister,

Donc pour avoir le nom de l'IOD correspondant:


snmpwalk -v 2c -c mycommunity -O n @IP | grep ATM0


Voila :)

seb974
07-20-2007, 11:27 AM
:p thanks, j'ai donc ces OID :)

snmpwalk -v 2c -c azqswx -O n 192.168.1.254 | grep ATM0
.1.3.6.1.2.1.2.2.1.2.6 = STRING: ATM0
.1.3.6.1.2.1.2.2.1.2.8 = STRING: ATM0-atm layer
.1.3.6.1.2.1.2.2.1.2.9 = STRING: ATM0.0-atm subif
.1.3.6.1.2.1.2.2.1.2.10 = STRING: ATM0-aal5 layer
.1.3.6.1.2.1.2.2.1.2.11 = STRING: ATM0.0-aal5 layer
.1.3.6.1.2.1.2.2.1.2.12 = STRING: ATM0-adsl
.1.3.6.1.2.1.2.2.1.2.14 = STRING: ATM0.1-atm subif
.1.3.6.1.2.1.2.2.1.2.15 = STRING: ATM0.1-aal5 layer
.1.3.6.1.2.1.31.1.1.1.1.8 = STRING: ATM0-atm layer
.1.3.6.1.2.1.31.1.1.1.1.9 = STRING: ATM0.0-atm subif
.1.3.6.1.2.1.31.1.1.1.1.10 = STRING: ATM0-aal5 layer
.1.3.6.1.2.1.31.1.1.1.1.11 = STRING: ATM0.0-aal5 layer
.1.3.6.1.2.1.31.1.1.1.1.14 = STRING: ATM0.1-atm subif
.1.3.6.1.2.1.31.1.1.1.1.15 = STRING: ATM0.1-aal5 layer
.1.3.6.1.2.1.47.1.1.1.1.2.8 = STRING: "ATM0-adsl"
.1.3.6.1.2.1.47.1.1.1.1.7.7 = STRING: "ATM0"

Ensuite ça fonctionne comme ceci alors :

./check_graph_traffic -H 192.168.1.254 -c azqswx -v 2c -i .1.3.6.1.2.1.2.2.1.2.12

ou

./check_graph_traffic -H 192.168.1.254 -c azqswx -v 2c -i .1.3.6.1.2.1.47.1.1.1.1.2.8

Et ça me donne le vrai de vrai traffic de l'interface ATM0-adsl ? :p

MrBrown
07-20-2007, 12:09 PM
Et ça me donne le vrai de vrai traffic de l'interface ATM0-adsl ? :p
Non pas du tout. -i correspond bien à l'indice que tu as récupéré en utilisant l'option -s.
Mais apparemment ton routeur ne contient pas les informations concernant le traffic entrant pour l'interface 12.
fait un snmpwalk sur cet OID pour voir si tu as des informations à l'index 12 : .1.3.6.1.2.1.2.2.1.10

Et utilise plutot check_centreon_snmp_traffic. Plusieurs bugs de check_graph_traffic ont été corrigés sur cette version.

seb974
07-20-2007, 01:05 PM
VOilà un snmpwalk sur l'oid :

snmpwalk -v 2c -c azqswx 192.168.1.254 .1.3.6.1.2.1.2.2.1.2.12
IF-MIB::ifDescr.12 = STRING: ATM0-adsl

MrBrown
07-23-2007, 11:09 AM
Tu n'as pas vraiment fait ce que je t'ai demandé. Pour faire simple, fait un snmpwalk sur l'OID .1.3.6.1.2.1.2.2.1.10.12 et .1.3.6.1.2.1.2.2.1.16.12. Si des valeurs sont affichées c'est que le plugin marche et que normalement il te retourne le traffic sur ton interface sinon c'est que les informations ne sont pas dispo et qu'il va falloir trouver un autre moyen (la MIB spécifique au constructeur par exemple). Voilà la syntaxe pour utiliser le plugin pour l'interface 12 :
./check_centreon_snmp_traffic -H 192.168.1.254 -C azqswx -v 1 -i 12

seb974
07-23-2007, 02:09 PM
$ snmpwalk -v 2c -c azqswx 192.168.1.254 .1.3.6.1.2.1.2.2.1.10.12
IF-MIB::ifInOctets.12 = No Such Instance currently exists at this OID

$ snmpwalk -v 2c -c azqswx 192.168.1.254 .1.3.6.1.2.1.2.2.1.16.12
IF-MIB::ifOutOctets.12 = No Such Instance currently exists at this OID

--

Sinon je suis sous Oreon 1.4, donc j'ai pas ce plugin :
check_centreon_snmp_traffic

Et j'ai peur que la migration 1.4 --> 1.4 RC1 échoue..., même si des sauvegardes peuvent être faites :)


Il y a pas moyen d'utiliser check_centreon_snmp_traffic sous Oreon 1.4 ? :p

---

J'ai fais un check sur l'interface 6 (ATM0), j'obtiens un graphique, mais est-ce le bon graphique, le vrai graphique de l'interface 6 ? :p

Traffic In : 228.63 kb/s (22.4 %), Out : 194.45 kb/s (19.0 %) - Total RX Bits In : 29.97 GB, Out : 21.03 Gb

./check_graph_traffic.pl -H 192.168.1.254 -C azqswx -s
Interface 1 :: FastEthernet0
Interface 2 :: FastEthernet1
Interface 3 :: FastEthernet2
Interface 4 :: FastEthernet3
Interface 5 :: Dot11Radio0
Interface 6 :: ATM0
Interface 7 :: Null0
Interface 8 :: ATM0-atm layer
Interface 9 :: ATM0.0-atm subif
Interface 10 :: ATM0-aal5 layer
Interface 11 :: ATM0.0-aal5 layer
Interface 12 :: ATM0-adsl
Interface 13 :: Vlan1
Interface 14 :: ATM0.1-atm subif
Interface 15 :: ATM0.1-aal5 layer
Interface 16 :: Dialer0
Interface 17 :: BVI1
Interface 18 :: Virtual-Dot11Radio0
Interface 19 :: Virtual-Access1