Ad Widget

Collapse

snmptrapd problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cpszx
    Junior Member
    • Sep 2004
    • 5

    #1

    snmptrapd problems

    Hi,

    sorry for the duplicate posting in the sourceforge forum, i thought i was on this browser window.

    Great product, which will be better with some of the wishlist items on the next release
    Also, might have some constructive suggestions after i get all the features working.

    i am having trouble with the snmptrapd, snmptrap.sh and zabbix_trapperd configuration.

    I found this from you on a previous thread :-
    =====
    Here is small checklist:

    1. zabbix_tarpperd is running and accepts connections from local host
    2. You have defined a special host and item for trapping
    3. Same host and key (Step2) should be configured in snmptrapd.conf
    4. Make sure that the script is called when you receive a trap. Add line "touch /tmp/something" to do this.
    5. Define LogFile in zabbix_trapperd.conf, check it after receiving trap.

    Regards,
    Alexei
    =======

    but am still having trouble.
    1. OK
    2. not sure if this is correct or not, no manual info on zabbix_trapper items....
    using an existing host entry
    item=zabbix trapper
    key=snmptrap.0
    type=character
    allowed hosts=trap sender ip
    3. as far as i can tell, subject to 2
    but have also tried moving HOST= to AFTER the address is determined, and set there.
    4. OK
    5. Got line:"I:snmptrap.0:172.16.100.223 "I 172.16.100.223 "public"
    followed by db insert fail.

    not convinced am getting the right data out of the trap info either.

    Regards,
    Craig
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    ZABBIX failed to insert record into database because of quotes in the trap message. I'm not sure where the quote characters comes from.

    Please add this line to the very end of snmptrap.sh:

    Code:
    echo $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str" >/tmp/snmptrap.log
    Generate a trap and show snmptrap.log.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • cpszx
      Junior Member
      • Sep 2004
      • 5

      #3
      Hi Alexei,

      here is the output from all of the log files, regarding me changing the time on a device.

      the first part is what snmptrapd logs in /var/log/messages,
      the second part is from your debug output in the last message,
      the third part is from the zabbix_trapperd.log

      I am on the debug trail this morning
      Regards,
      Craig

      Oct 4 10:29:01 localhost snmptrapd[2902]: 172.16.100.223: Enterprise Specific Trap (2) Uptime: 15 days, 8:11:14.55, SNMPv2-SMI::mib-2.16.9.1.1.2.176 = STRING: "I 10/03/04 10:29:09 mgr: changing time"
      Oct 4 10:29:01 localhost snmptrapd[2902]: 172.16.100.223: Enterprise Specific Trap (2) Uptime: 15 days, 8:11:14.55, SNMPv2-SMI::mib-2.16.9.1.1.2.177 = STRING: "I 10/03/04 10:28:09 mgr: new time set"


      /usr/local/bin/zabbix_sender 172.16.50.37 10001 "I:snmptrap.0 172.16.100.223 "I 172.16.100.223 "public"


      005009:20041004:102901 After accept()
      005009:20041004:102901 Before read()
      005009:20041004:102901 After read() 2 [57]
      005009:20041004:102901 Got line:"I:snmptrap.0:172.16.100.223 "I 172.16.100.223 "public"
      005009:20041004:102901 In process_data()
      005009:20041004:102901 Executing query:select i.itemid,i.key_,h.host,h.port,i.delay,i.descriptio n,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h .useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.va lue_type,i.trapper_hosts,i.delta from items i,hosts h where h.status in (0,2) and h.hostid=i.hostid and h.host='"I' and i.key_='snmptrap.0' and i.status=0 and i.type=2
      005009:20041004:102901 In DBnum_rows
      005009:20041004:102901 Sending back [NOT OK
      ]
      005009:20041004:102901 Length [7]
      005009:20041004:102901 Sockfd [1]
      005009:20041004:102901 After write()
      005009:20041004:102901 Before accept()
      005010:20041004:102901 After accept()
      005010:20041004:102901 Before read()
      005010:20041004:102901 After read() 2 [57]
      005010:20041004:102901 Got line:"I:snmptrap.0:172.16.100.223 "I 172.16.100.223 "public"
      005010:20041004:102901 In process_data()
      005010:20041004:102901 Executing query:select i.itemid,i.key_,h.host,h.port,i.delay,i.descriptio n,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h .useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.va lue_type,i.trapper_hosts,i.delta from items i,hosts h where h.status in (0,2) and h.hostid=i.hostid and h.host='"I' and i.key_='snmptrap.0' and i.status=0 and i.type=2
      005010:20041004:102901 In DBnum_rows
      005010:20041004:102901 Sending back [NOT OK
      ]
      005010:20041004:102901 Length [7]
      005010:20041004:102901 Sockfd [1]
      005010:20041004:102901 After write()
      005010:20041004:102901 Before accept()

      Comment

      • cpszx
        Junior Member
        • Sep 2004
        • 5

        #4
        ok, snmp v2 issues?

        ok,
        i have found why i was not logging the traps to the database.
        need to match the HOST value with the host name properly. i was too used to using the ip address.
        set up a generic snmptrap host, like you suggest and it was logging traps...
        So, once i get the dns resolution setup properly, i can probably trap to individual host entries in the database, rather than a generic one.

        BUT, it seems the trap format might be different ? I have output the read variables for debug:

        hostname==172.16.100.223
        oid==SNMPv2-MIB::snmpTrapOID.0 SNMPv2-SMI::enterprises.11.2.3.7.11.23.0.2
        ip==172.16.100.223
        address==SNMPv2-SMI::mib-2.16.9.1.1.2.176 "I 10/03/04 10:47:56 mgr: changing time"
        community==SNMP-COMMUNITY-MIB::snmpTrapAddress.0 172.16.100.223
        enterprise==SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 "public"

        I am monitoring an HP4108 switch.

        Regards,
        Craig

        Comment

        Working...