Ad Widget

Collapse

How to read snmptrap for monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raid3868
    Junior Member
    • May 2019
    • 4

    #1

    How to read snmptrap for monitoring

    Dear All

    All zabbix experts need help on how to read snmptrap for monitoring in zabbix 4.
    Currently one of my 8 port switch is sending out snmp trap to my zabbix 4 server and i have configured zabbix to receive trap and my trap file is stored at /tmp/zabbix_traps.tmp
    at zabbix host i have created Template SNMP Trap fallback: SNMP Trap fallback and Trigger Template SNMP trap fallback: Unmatched SNMP trap received from {HOST.NAME} {192.168.1.10.switch.local.com:snmptrap.fallback.n odata(300)}=10

    I can see the data at /tmp/zabbix_traps.tmp and also at monitoring but have no idea to read to zabbix for monitoring, graph .

    Many thanks if experts can help.







    Attached Files
  • Manishk
    Junior Member
    • Apr 2019
    • 12

    #2
    Dear raid3868,
    we can monitor the snmptrap using zabbix through SNMP Interfaces.
    I would recommend you to follow the following steps:-
    1. create Host by adding SNMP interfaces
    2.create item with Type:- SNMP trap, key:- snmptrap.fallback, Type of information:- Log
    3. change /etc/zabbix/zabbix_server.conf
    StartSNMPTrapper=1
    SNMPTrapperFile= [TRAP FILE]
    4.Restart Zabbix service
    5. Check the output in Monitoring, latest data.

    Please Do let me know if your issue is not resolved.

    Comment

    • raid3868
      Junior Member
      • May 2019
      • 4

      #3
      Dear Maishk

      Many Many Thank for you fast reply.

      I have all done this step. I can view the data at zabbix > monitoring > latest data > mysnmptraphost -> history
      2019-07-25 15:20:02 2019-07-25 15:20:02 15:20:02 2019/07/25 PDU INFO: errorindex 0 notificationtype TRAP community puclic messageid 0 transactionid 3528 errorstatus 0 requestid 1492675512 version 1 receivedfrom UDP: [192.168.1.10]:59079->[192.168.1.50]:162 VARBINDS: DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (215404697) 24 days, 22:20:46.97 SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.37288.1.4.4.0 SNMPv2-SMI::mib-2.47.1.1.1.1.15.1 type=4 value=STRING: "ABC12345678110123" IF-MIB::ifHCInOctets.1 type=70 value=Counter64: 5275487 IF-MIB::ifHCInOctets.7 type=70 value=Counter64: 80992592583 IF-MIB::ifHCInOctets.8 type=70 value=Counter64: 106796418121 IF-MIB::ifHCInOctets.19 type=70 value=Counter64: 104100144573 IF-MIB::ifHCInOctets.9 type=70 value=Counter64: 82858119498 IF-MIB::ifHCInOctets.20 type=70 value=Counter64: 80935273882 IF-MIB::ifHCInOctets.10 type=70 value=Counter64: 104682843670 IF-MIB::ifHCInOctets.21 type=70 value=Counter64: 102079131178 IF-MIB::ifHCInOctets.11 type=70 value=Counter64: 85509377082 IF-MIB::ifHCInOctets.12 type=70 value=Counter64: 767578972 IF-MIB::ifHCInOctets.13 type=70 value=Counter64: 84244794992 IF-MIB::ifHCInOctets.14 type=70 value=Counter64: 110753919426 IF-MIB::ifHCInOctets.22 type=70 value=Counter64: 107921901484 IF-MIB::ifHCInOctets.23 type=70 value=Counter64: 501018920879 IF-MIB::ifHCInOctets.24 type=70 value=Counter64: 3528 IF-MIB::ifHCInOctets.32 type=70 value=Counter64: 52859603657 IF-MIB::ifHCInOctets.31 type=70 value=Counter64: 52658561856 IF-MIB::ifHCInOctets.25 type=70 value=Counter64: 102218438530 IF-MIB::ifHCInOctets.28 type=70 value=Counter64: 79569189182 IF-MIB::ifHCInOctets.30 type=70 value=Counter64: 100259128878 IF-MIB::ifHCInOctets.26 type=70 value=Counter64: 105949691851
      This is a 8 port switch and i think IF-MIB::ifHCInOctets.30 is represent a port my question is how can i read this to zabbix with every IF-MIB::ifHCInOctets as a individual item
      so i can keep their history.

      example: this one of my cisco switch
      Interface gi27(): Bits sent 2019-07-25 15:26:53 436.5 Kbps +311.62 Kbps Graph
      Interface gi27(): Bits received 2019-07-25 15:26:53 26.6 Kbps +10.95 Kbps Graph


      Thanks you very very much






      Comment


      • Hamardaban
        Hamardaban commented
        Editing a comment
        "SNMP traps" and "SNMP get" are two big differences.
    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #4
      No graph because the data is trap - string type. You can't build graphs on string values. But for example, you can make a calculated data item with the formula count("snmptrap.fallback",300) - number of traps for 5 minutes. And watch this chart.

      Comment


      • Hamardaban
        Hamardaban commented
        Editing a comment
        Or use preprocessing to extract the values and convert it to numeric

        Or use depended items with regex to the same purpose
    Working...