Ad Widget

Collapse

Problems resolving OIDs with snmptrap.pl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grenzlaeufer
    Junior Member
    • Nov 2010
    • 24

    #1

    Problems resolving OIDs with snmptrap.pl

    Hallo!

    I am working far to long on this problem. No searching or reading manuals helped me.

    I want to receive with snmptrad snmp-traps and send them by snmptrap.pl to zabbix. This works fine, but I don´t get the OIDs resolved, so it is not possible to understand the snmp-mails with a lot of OIDs.
    If I send a test-trap from an ILO-Board I get this message in my snmptrapd.log:

    Code:
    2010-12-20 20:32:56 server-ilo.domain-so.net [192.168.1.2] (via UDP: [151.189.37.58]:1267->[151.189.37.13]) TRAP, SNMP v1, community COMPAQ
    	.1.3.6.1.4.1.232 Enterprise Specific Trap (11003) Uptime: 34 days, 6:15:46.30
    	.1.3.6.1.2.1.1.5.0 = STRING: host is unnamed	.1.3.6.1.4.1.232.11.2.11.1 = INTEGER: 0	.1.3.6.1.4.1.232.11.2.8.1 = STRING: "Remote Insight Test Trap"
    This information is transfered to the traphandler snmptrap.pl, which posts to its debug.log:
    Code:
    2011-01-03 13:00:14 -- 32707 --/usr/sbin/zabbix-sender --zabbix-server 127.0.0.1 --port 10051 --host snmptraps --key snmptraps --value "(zabbix.domain.net, 151.189.37.58) , .1.3.6.1.2.1.1.3.0: 47:22:43:17.03, .1.3.6.1.6.3.1.1.4.1.0: .1.3.6.1.4.1.232.0.11003, .1.3.6.1.2.1.1.5.0: host is unnamed, .1.3.6.1.4.1.232.11.2.11.1: 0, .1.3.6.1.4.1.232.11.2.8.1: \"Remote Insight Test Trap\", .1.3.6.1.6.3.18.1.3.0: 151.189.37.58, .1.3.6.1.6.3.18.1.4.0: \"COMPAQ\", .1.3.6.1.6.3.1.1.4.3.0: .1.3.6.1.4.1.232"
    If I try to resolve an OID with snmptranslate then it works:
    Code:
    server:/etc/snmp # snmptranslate 1.3.6.1.2.1.1.5.0
    SNMPv2-MIB::sysName.0
    I am somehow irritated if I start the snmpd manually:

    # snmptrapd -f -Le -Dparse-mibs 2>&1 | grep SNMPv2-MIB
    Code:
    parse-mibs:   Module 92 SNMPv2-MIB is in /root/.snmp/mibs/snmpv2-mib.mib
    parse-mibs:   Module SNMPv2-MIB already noted
    parse-mibs:     SNMPv2-MIB is now in /usr/share/snmp/mibs/SNMPv2-MIB.txt
    parse-mibs: Parsing MIB: 92 SNMPv2-MIB
    parse-mibs: Processing IMPORTS for module 92 SNMPv2-MIB
    parse-mibs: Module SNMPv2-MIB already loaded
    parse-mibs: Module SNMPv2-MIB already loaded
    Cannot find module (CPQOS-MIB +CPQDCEO-MIB +RFC1213 +SNMPv2-SMI +SNMPv2-MIB): At line 0 in (none)
    Despite that the snmpd tries to load some modules twice, it seams to load the SNMPv2-MIB and tells later that it can´t find the module. Could this be the reason for my problem?

    At last I show you my configs:

    this is my snmp.conf:
    Code:
    server:/etc/snmp # cat snmp.conf 
    mibs SNMPv2-MIB
    showMibErrors 0
    mibAllowUnderline 1
    and my snmptrapd.conf:
    Code:
    traphandle default /usr/bin/perl /etc/zabbix/bin/snmptrap.pl
    disableAuthorization yes
    donotlogtraps  no
    doNotRetainNotificationLogs yes
    ignoreAuthFailure yes
    my snmpd.conf:
    Code:
    syslocation Server Room
    syscontact Sysadmin (root@localhost)
    rocommunity public 127.0.0.1
    This is the configuration-part of my snmptrapd.pl
    Code:
    use strict;
    use DBI;
    
    my $DEBUG = 1;
    my $DEBUGFILE = "/tmp/zabbix_snmptrapdebug.log";
    my $ZABBIX_SERVER = "127.0.0.1";                     # Hostname/IP-Address of zabbix-server
    my $ZABBIX_PORT = 10051;                                # Port of zabbix-server (Default: 10051)
    my $ZABBIX_ITEM = "snmptraps";                          # Default item name to send traps to
    my $ZABBIX_SENDER = "/usr/sbin/zabbix-sender";    # Path to your zabbix-sender
    my $WILDCARD_HOST =  "snmptraps";                       # Hostname or IP-Adress of wildcard-host within zabbix
    my $SEND_ALL_TO_WILDCARD = 1;                       # Send all traps to wildcard host
    my $ZABBIX_DB_HOST="127.0.0.1";
    my $ZABBIX_DB_NAME="zabbix";
    my $ZABBIX_DB_USER="zabbix";
    my $ZABBIX_DB_PASS="SecrEtPasS";
    my $TRAPEXCLUDEFILE="/etc/zabbix/traps_to_exclude";
    my $ALIASFILE="/etc/zabbix/aliasfile";
    my $TRIMLONGVALUES=1;
    my $KEYOIDNAME="SNMPv2-MIB::snmpTrapOID.0";

    Systen configuration
    Linux: SLES 11 SP1
    Software:
    snmp-mibs-5.4.2.1-8.5.1
    snmptt-1.2-1.1
    libsnmp15-5.4.2.1-8.5.1
    net-snmp-5.4.2.1-8.5.1

    I would be very grateful if someone coult point me into the right direction!
  • Ori0n
    Member
    • Dec 2010
    • 35

    #2
    Is your snmptrapd somehow defaulting to "-On" or something similar?

    Does that error regarding the SNMPv2-MIB mib go away if you restrict the MIB directory to either /root/.snmp/mibs or /usr/share/snmp/mibs with "-M"?

    Comment

    • misch42
      Junior Member
      • Nov 2010
      • 8

      #3
      Hi,

      did you enable the additional enterprise MIBs in your setup? See
      -m and -M options in "man snmpcmd" and
      corresponding ooptions in "man snmp.conf"

      Michael Schwartzkopff

      Comment

      • grenzlaeufer
        Junior Member
        • Nov 2010
        • 24

        #4
        Thank you for the replies! I found the problem thanks to Ori0n. It was the "-On"-Option. I shouldn´t rely on the configuration other people built up. With snmptt everything was fine as far as I was told, but now I have to built up zabbix with snmp.
        Thank you very much!

        Comment

        • Ori0n
          Member
          • Dec 2010
          • 35

          #5
          Thank you for the replies! I found the problem thanks to Ori0n. It was the "-On"-Option. I shouldn´t rely on the configuration other people built up. With snmptt everything was fine as far as I was told, but now I have to built up zabbix with snmp.
          Ha, using SNMPTT is what caused me to think of the "-On" option possibly fouling things up.

          On a possibly related note it is possible to integrate SNMPTT and Zabbix:
          Zabbix is a great monitoring tool, however it’s built-in trap handling scripts lack the flexibility to hold up to large setups.  This is just one method of utilizing SNMPTT to receive and mas…


          Glad you got it worked out.

          Comment

          • grenzlaeufer
            Junior Member
            • Nov 2010
            • 24

            #6
            Thanks for the link Ori0n, its bookmarked, but I wan´t first to take the infrastructure we have.
            I have only one single question: How can I manually change the trigger status: problem to ok? sometimes i get snmp-traps about java exceptions which don´t recover in a way zabbix excepts it.

            Comment

            • Ori0n
              Member
              • Dec 2010
              • 35

              #7
              How can I manually change the trigger status: problem to ok?
              You can't change it manually, but you can do it automatically. Look here for an example of how to do this with a trigger (use the nodata function):

              Comment

              Working...