View Full Version : SNMP commands give error messages since installing Centreon
mrcoffee
08-20-2008, 09:04 PM
Bonjour!
Since the installation of Centreon on my server I have a problem with SNMP. MIB files I uploaded before installing Centreon to be used with Nagios-plugins I wrote, now suddenly seem to give to give problems after installing Centreon.
# snmpwalk -v1 -C hostname
Bad format for OBJECT-TYPE (END): At line 79 in /usr/share/snmp/mibs/RFC-1212.mib
Bad parse of OBJECT-TYPE: At line 79 in /usr/share/snmp/mibs/RFC-1212.mib
Undefined OBJECT (wsTrapEnableWirelessUnapprovedAPRemoved): At line 2481 in /usr/share/snmp/mibs/WS-TRAP-MIB.mib
Undefined NOTIFICATION (wsTrapWirelessUnapprovedAPRemoved): At line 2446 in /usr/share/snmp/mibs/WS-TRAP-MIB.mib
Unknown module (wsSwNTPModule): At line 1250 in /usr/share/snmp/mibs/WS-SW-AUTHENTICATEDNTP-MIB.mib
Unknown module (SYMBOL-CC-WS5000-MIB): At line 3502 in /usr/share/snmp/mibs/SYMBOL-WS5000-MIB.mib
Did not find 'VlanIdOrNone' in module Q-BRIDGE-MIB (/usr/share/snmp/mibs/NORTEL-SECURE-NETWORK-ACCESS-MIB.mib)
Did not find 'MacAddress' in module S5-TCS-MIB (/usr/share/snmp/mibs/s5emt103.mib)
Did not find 'vrrpOperPrimaryIpAddr' in module VRRP-MIB (/usr/share/snmp/mibs/BAY-STACK-VRRP-EXT-MIB.mib)
grep: Unknown Object Identifier (Sub-id not found: (top) -> grep)
All the ouput on my snmp commands like snmpwalk give these error messages. Looks like Cantreon is doing something to the SNMP files.
Does anyone have an idea how to fix this?
surcouf
08-20-2008, 11:04 PM
Bonjour!
Since the installation of Centreon on my server I have a problem with SNMP. MIB files I uploaded before installing Centreon to be used with Nagios-plugins I wrote, now suddenly seem to give to give problems after installing Centreon.
# snmpwalk -v1 -C hostname
Bad format for OBJECT-TYPE (END): At line 79 in /usr/share/snmp/mibs/RFC-1212.mib
Bad parse of OBJECT-TYPE: At line 79 in /usr/share/snmp/mibs/RFC-1212.mib
Undefined OBJECT (wsTrapEnableWirelessUnapprovedAPRemoved): At line 2481 in /usr/share/snmp/mibs/WS-TRAP-MIB.mib
Undefined NOTIFICATION (wsTrapWirelessUnapprovedAPRemoved): At line 2446 in /usr/share/snmp/mibs/WS-TRAP-MIB.mib
Unknown module (wsSwNTPModule): At line 1250 in /usr/share/snmp/mibs/WS-SW-AUTHENTICATEDNTP-MIB.mib
Unknown module (SYMBOL-CC-WS5000-MIB): At line 3502 in /usr/share/snmp/mibs/SYMBOL-WS5000-MIB.mib
Did not find 'VlanIdOrNone' in module Q-BRIDGE-MIB (/usr/share/snmp/mibs/NORTEL-SECURE-NETWORK-ACCESS-MIB.mib)
Did not find 'MacAddress' in module S5-TCS-MIB (/usr/share/snmp/mibs/s5emt103.mib)
Did not find 'vrrpOperPrimaryIpAddr' in module VRRP-MIB (/usr/share/snmp/mibs/BAY-STACK-VRRP-EXT-MIB.mib)
grep: Unknown Object Identifier (Sub-id not found: (top) -> grep)
All the ouput on my snmp commands like snmpwalk give these error messages. Looks like Cantreon is doing something to the SNMP files.
Does anyone have an idea how to fix this?
Can you check if you have every dependancies for theses requested MIB ?
Example :
$ for mib in WS-TRAP-MIB AUTHENTICATEDNTP-MIB SYMBOL-WS5000-MIB NORTEL-SECURE-NETWORK-ACCESS-MIB s5emt103 BAY-STACK-VRRP-EXT-MIB; do for deps in $(grep FROM /usr/share/snmp/mibs/$mib.*| awk '{print $2}' |tr '\n' ' '); head /usr/share/snmp/mibs/* |grep $deps ; done; done
You've to resolve errors published by SNMP if you don't want to have theses messages again.
mrcoffee
08-21-2008, 11:18 AM
for mib in WS-TRAP-MIB AUTHENTICATEDNTP-MIB SYMBOL-WS5000-MIB NORTEL-SECURE-NETWORK-ACCESS-MIB s5emt103 BAY-STACK-VRRP-EXT-MIB; do for deps in $(grep FROM /usr/share/snmp/mibs/$mib.*| awk '{print $2}' |tr '\n' ' '); do /usr/bin/head /usr/share/snmp/mibs/* |grep $deps ; done; done
Thanks for your reply!
The code missed the second 'do' command and after adding this I got a huge amount of output. Its to much to put it overhere. And I have no idea what to do with this.
I will put the first few lines here, maybe you can help me with this. Thanks, appreciate it very much!
Roderick
---------
FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
NOTIFICATION-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF;
FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF;
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
NOTIFICATION-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF;
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
FROM SNMPv2-CONF
......... and continueing
mrcoffee
08-22-2008, 05:11 PM
Ok, the error messages appear after changes Centreon makes in the snmp configuration of the server.
Centreon install script creates among others /etc/snmp/snmp.conf containing:
mibs ALL
mibAllowUnderline 1
When disable mibs ALL the error output dissapears. Is it a problem to disable this line?
surcouf
08-22-2008, 06:19 PM
Ok, the error messages appear after changes Centreon makes in the snmp configuration of the server.
Centreon install script creates among others /etc/snmp/snmp.conf containing:
mibs ALL
mibAllowUnderline 1
When disable mibs ALL the error output dissapears. Is it a problem to disable this line?
If you need to have ALL your mib to be loaded by Net-SNMP tools and librairies, you'll need this option.
But, some MIB are missing and needed by some MIB you already have.
Can you list the MIB that has been added to your system ?
mrcoffee
08-25-2008, 01:05 PM
I don't need to load all the MIB files in advance, but maybe Centreon does. The installation of Centreon adds the "mibs ALL" parameter to the file, it even creates this file.
The MIB files I added:
BAY-STACK-ADAC-MIB.mib
BAY-STACK-ARP-INSPECTION-MIB.mib
BAY-STACK-DHCP-SNOOPING-MIB.mib
BAY-STACK-EAPOL-EXTENSION-MIB.mib
BAY-STACK-ECMP-MIB.mib
BAY-STACK-ERROR-MESSAGE-MIB.mib
BAY-STACK-LACP-EXT-MIB.mib
BAY-STACK.mib
BAY-STACK-MULTICAST-FLOODING-MIB.mib
BAY-STACK-NOTIFICATIONS-MIB.mib
BAY-STACK-OSPF-EXT-MIB.mib
BAY-STACK-OSPF-EXT-MIB.mib
BAY-STACK-RADIUS-MIB.mib
BAY-STACK-SOURCE-GUARD-MIB.mib
BAY-STACK-STATS-MIB.mib
BAY-STACK-VRRP-EXT-MIB.mib
BN-IF-EXTENSIONS-MIB.mib
BN-LOG-MESSAGE-MIB.mib
BRIDGE-MIB.mib
RAPID-CITY.mib
And some more... I have to compare it with a clean Fedora install. I'll do that later today.
In a testenvironment I deleted all the files snmpwalk was complaining about and the error dissapeared. I don't know if this brakes anything. Still when I preload the mib files with the ALL option, some of the output of my Nortel switches is corrupted so there must be a conflict. But the SNMP commands don't complain anymore (no error output). I have no idea how to resolve this issue.
This SNMP stuff is so... unclear. I know one file depends on another. The question is always how do you find out which one you need. And in the example above there must be conflict somewhere. But don't know where.
So for know I don't use the ALL option.
surcouf
08-25-2008, 06:43 PM
I don't need to load all the MIB files in advance, but maybe Centreon does. The installation of Centreon adds the "mibs ALL" parameter to the file, it even creates this file.
The MIB files I added:
BAY-STACK-ADAC-MIB.mib
BAY-STACK-ARP-INSPECTION-MIB.mib
BAY-STACK-DHCP-SNOOPING-MIB.mib
BAY-STACK-EAPOL-EXTENSION-MIB.mib
BAY-STACK-ECMP-MIB.mib
BAY-STACK-ERROR-MESSAGE-MIB.mib
BAY-STACK-LACP-EXT-MIB.mib
BAY-STACK.mib
BAY-STACK-MULTICAST-FLOODING-MIB.mib
BAY-STACK-NOTIFICATIONS-MIB.mib
BAY-STACK-OSPF-EXT-MIB.mib
BAY-STACK-OSPF-EXT-MIB.mib
BAY-STACK-RADIUS-MIB.mib
BAY-STACK-SOURCE-GUARD-MIB.mib
BAY-STACK-STATS-MIB.mib
BAY-STACK-VRRP-EXT-MIB.mib
BN-IF-EXTENSIONS-MIB.mib
BN-LOG-MESSAGE-MIB.mib
BRIDGE-MIB.mib
RAPID-CITY.mib
And some more... I have to compare it with a clean Fedora install. I'll do that later today.
In a testenvironment I deleted all the files snmpwalk was complaining about and the error dissapeared. I don't know if this brakes anything. Still when I preload the mib files with the ALL option, some of the output of my Nortel switches is corrupted so there must be a conflict. But the SNMP commands don't complain anymore (no error output). I have no idea how to resolve this issue.
This SNMP stuff is so... unclear. I know one file depends on another. The question is always how do you find out which one you need. And in the example above there must be conflict somewhere. But don't know where.
So for know I don't use the ALL option.
For example, I take NORTEL-SECURE-NETWORK-ACCESS-MIB (https://netdot.uoregon.edu/trac/browser/trunk/mibs/nortel/nortelsecurenetworkaccess.mib?rev=1916).
at the top of this file, we have theses following lines :
1
2 NORTEL-SECURE-NETWORK-ACCESS-MIB DEFINITIONS ::= BEGIN
3
4 IMPORTS
5 OBJECT-TYPE, MODULE-IDENTITY, NOTIFICATION-TYPE, Integer32
6 FROM SNMPv2-SMI
7 TEXTUAL-CONVENTION, TruthValue, RowStatus, MacAddress
8 FROM SNMPv2-TC
9 InterfaceIndex
10 FROM IF-MIB
11 SnmpAdminString
12 FROM SNMP-FRAMEWORK-MIB
13 VlanId, VlanIdOrNone
14 FROM Q-BRIDGE-MIB
15 InetAddressType, InetAddress, InetAddressPrefixLength, InetPortNumber
16 FROM INET-ADDRESS-MIB
17 IdList
18 FROM RAPID-CITY
19 bayStackMibs
20 FROM SYNOPTICS-ROOT-MIB;
This is the list of which objects are needed by this MIB. Each object is defined by another MIB : you must have all theses needed MIB to be located and loaded by Net-SNMP library. MIB files must be placed in /usr/share/snmp/mibs directory (or add the directory to MIBDIRS[1][2] variable), and MIB name must be added to MIB[1][2] variable.
If I'm looking your list, you're missing at least from support of :
- SYNOPTICS-ROOT-MIB (https://netdot.uoregon.edu/trac/browser/trunk/mibs/nortel/synro.mib?rev=1916),
- Q-BRIDGE-MIB (http://www.oidview.com/mibs/0/Q-BRIDGE-MIB.html).
You must add every needed MIB to MIBS environnement variable (or in snmp.conf).
[1]: http://net-snmp.sourceforge.net/docs/man/snmpcmd.html#lbAK
[2]: http://net-snmp.sourceforge.net/docs/man/snmp.conf.html#lbAH
mrcoffee
08-26-2008, 04:11 PM
Aha!
Your info and the links will helps me a lot. Merci a vous!
I found out I added dozens of MIB files. And I bet I don't need them all. Is it possible to find out which MIB file I need if I know the o.i.d's I'm trying to query? Or just delete them all and try my plugins one by one and start adding MIB files?
surcouf
08-26-2008, 06:15 PM
Aha!
Your info and the links will helps me a lot. Merci a vous!
I found out I added dozens of MIB files. And I bet I don't need them all. Is it possible to find out which MIB file I need if I know the o.i.d's I'm trying to query? Or just delete them all and try my plugins one by one and start adding MIB files?
You can find OID used by plugins by looking source code.
mrcoffee
08-26-2008, 10:02 PM
Ah oui, biensur.
Problem is often finding the right MIB file...
mrcoffee
08-27-2008, 12:14 PM
I'm sorry to bother you again, that's what happens if you give intelligent answers on a subject that not many people master ;)
I solved all the issues with the dependencies. I preload the mib files (MIB ALL in /etc/snmp/snmp.conf) and now I still have a problem.
With preload I get a corrupted output on the following command:
# snmpbulkwalk -v2c -c public switch01 SNMPv2-SMI::mib-2.17.4.3.1.2.0.80.86.184.4.206
BRIDGE-MIB::dot1dTpFdbPort.'.PV...' = INTEGER: 209
When i execute the command without preloading the MIB files I get the correct output:
RFC1213-MIB::mib-2.17.4.3.1.2.0.80.86.184.4.206 = INTEGER: 209
Do you have a clue what's happening here? Is it that certain MIB files can not reside on the same system because they can cause problems? Is this like the so called Windows DLL hell ;)?
Thanks!
mrcoffee
08-27-2008, 02:21 PM
Ok, I think there is a conflict with the two MIB files BRIDGE-MIB.mib and RFC1213-MIB..mib. When I preload the files the snmpwalk command uses BRIDGE-MIB.mib and comes back with info for "dot1dTpFdbPort" and this gives me a wrongly formatted output. When I don't preload RFC1213-MIB seems to be used to present the right info format.
So, how do I solve this? Deleting BRIDGE-MIB does not help (and it's needed too).
surcouf
08-27-2008, 03:25 PM
Ok, I think there is a conflict with the two MIB files BRIDGE-MIB.mib and RFC1213-MIB..mib. When I preload the files the snmpwalk command uses BRIDGE-MIB.mib and comes back with info for "dot1dTpFdbPort" and this gives me a wrongly formatted output. When I don't preload RFC1213-MIB seems to be used to present the right info format.
So, how do I solve this? Deleting BRIDGE-MIB does not help (and it's needed too).
There's no conflict. Without BRIDGE-MIB, snmp commands can only resolve OID partially.
The symbolic name of this numeric OID, 1.3.6.1.2.1, is "mib-2" and it's defined by RFC1213-MIB. The last part of this OID can be resolved.
Net-SNMP is looking for MIB files to one or many directory. By default, /usr/local/share/snmp/mibs, if you have install Net-SNMP by hand or /usr/share/snmp/mibs, if you've used RPM or debian packages. This default directory is set at compilation time.
You can add another directory by using MIBDIRS variable, as environnement variable or configuration directive of a snmp.conf file.
And you MUST add no default MIB to MIBS variable as I've already explain before.
http://net-snmp.sourceforge.net/docs/man/snmp.conf.html#lbAH
http://net-snmp.sourceforge.net/docs/man/snmpcmd.html#lbAK
mrcoffee
09-07-2008, 04:32 PM
Thnx for you reply!
I had to work on other stuff so I was not able to look into this for a while, but I'm going to do so now.
Grtz,
Roderick
mrcoffee
09-07-2008, 05:13 PM
Ok, if I understand correctly all directories which you want to use can be added to the MIBDIRS variable. And I can add this variable to the environment or to the snmp.conf file.
All my MIB files are in the default directory so if I'm correct I don't have to add directories to the MIBDIRS variable, and I haven't.
I use the MIBS all variable in the snmp.conf file. The problem is that the ouput of the following command is corrupted:
# snmpbulkwalk -v2c -c public switch01 SNMPv2-SMI::mib-2.17.4.3.1.2.0.80.86.184.4.206
BRIDGE-MIB::dot1dTpFdbPort.'.PV...' = INTEGER: 209
When i execute the command without preloading the MIB files I get the correct output:
RFC1213-MIB::mib-2.17.4.3.1.2.0.80.86.184.4.206 = INTEGER: 209
Maybe you are trying to tell me the sollution and I don't see it, for me this still looks like a conflict between MIB files. Maybe I have to put a mib file in another directory and add this one to the MIBDIRS directory to control the order in which mib files are loaded?
Thnx for bearing with me ;)
surcouf
09-07-2008, 11:11 PM
Ok, if I understand correctly all directories which you want to use can be added to the MIBDIRS variable. And I can add this variable to the environment or to the snmp.conf file.
All my MIB files are in the default directory so if I'm correct I don't have to add directories to the MIBDIRS variable, and I haven't.
I use the MIBS all variable in the snmp.conf file. The problem is that the ouput of the following command is corrupted:
# snmpbulkwalk -v2c -c public switch01 SNMPv2-SMI::mib-2.17.4.3.1.2.0.80.86.184.4.206
BRIDGE-MIB::dot1dTpFdbPort.'.PV...' = INTEGER: 209
When i execute the command without preloading the MIB files I get the correct output:
RFC1213-MIB::mib-2.17.4.3.1.2.0.80.86.184.4.206 = INTEGER: 209
Maybe you are trying to tell me the sollution and I don't see it, for me this still looks like a conflict between MIB files. Maybe I have to put a mib file in another directory and add this one to the MIBDIRS directory to control the order in which mib files are loaded?
There's no conflict, that's all.
The first output is the fully translated name of this OID with the index :
BRIDGE-MIB::dot1dTpFdbPort is the symbolic name of 1.3.6.1.2.1.17.4.3.1.2.
The last part is the index name of this instance : '.PV...' = 0.80.86.184.4.206.
The second output isn't complete because the numeric name of RFC1213-MIB::mib-2 is 1.3.6.1.2.1.
The last part can be translated, including index name.