Ad Widget

Collapse

how to configure the snmptrap?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxpaynebupt
    Junior Member
    • Nov 2015
    • 2

    #1

    how to configure the snmptrap?

    hi

    I want to connect snmptrap, and then show in zabbix, but failed to show in zabbix gui, here is the config:


    /etc/zabbix/zabbix_server.conf:
    #SNMP Trapper
    StartSNMPTrapper=1
    SNMPTrapperFile=/var/log/snmptt/snmptt.log

    /etc/snmp/snmptt.ini:
    log_file = /var/log/snmptt/snmptt.log

    /etc/snmp/snmptt.conf:
    EVENT general .* "General event" Normal
    FORMAT ZBXTRAP $aA $ar

    created a host:
    SNMP interfaces: 192.168.254.37 port 161

    add item to host:
    Type: snmp trap
    key:snmptrap["General"]
    hostinterface:192.168.254.37:161
    Type of information:character



    I can see the snmptrap in /var/log/snmptt/snmptt.log:
    17:42:19 2015/11/06 .2.3.6.1.4.1.1916.0.3 Normal "General event" 192.168.254.37 - ZBXTRAP 192.168.254.37 192.168.254.37


    Anybody knows what's wrong or how to find why? thanks.

    BTW: I found no log in zabbix server log.
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hi,

    As an alternative you van try using the perl script approach for SNMP traps as described here:
    Join the friendly and open Zabbix community on our forums and social media platforms.


    It is a bit easier than using SNMPTT.

    Best Regards,
    Ingus

    Comment

    • lxh9090
      Junior Member
      • Aug 2018
      • 7

      #3
      1、/etc/zabbix/zabbix_proxy.conf
      StartSNMPTrapper=1
      SNMPTrapperFile=/var/log/zabbix/zabbix_traps.log

      2、/etc/snmp/snmptrapd.conf
      disableAuthorization yes
      perl do "/usr/bin/zabbix_trap_receiver.pl"


      3、/var/log/zabbix/zabbix_traps.log

      14:48:47 2018/08/28 ZBXTRAP 10.81.0.3
      PDU INFO:
      notificationtype TRAP
      version 0
      receivedfrom UDP: [10.81.0.3]:64332->[10.22.16.77]:162
      errorstatus 0
      messageid 0
      community public
      transactionid 548
      errorindex 0
      requestid 0
      VARBINDS:
      DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (2159745587) 249 days, 23:17:35.87
      SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.9.9.41.2.0.1
      SNMPv2-SMI::enterprises.9.9.41.1.2.3.1.2.253936 type=4 value=STRING: "CDP"
      SNMPv2-SMI::enterprises.9.9.41.1.2.3.1.3.253936 type=2 value=INTEGER: 5
      SNMPv2-SMI::enterprises.9.9.41.1.2.3.1.4.253936 type=4 value=STRING: "NATIVE_VLAN_MISMATCH"
      SNMPv2-SMI::enterprises.9.9.41.1.2.3.1.5.253936 type=4 value=STRING: "Native VLAN mismatch discovered on GigabitEthernet1/22 (1), with JSDS-BG-2960-3 FastEthernet0/34 (15)."
      SNMPv2-SMI::enterprises.9.9.41.1.2.3.1.6.253936 type=67 value=Timeticks: (2159745587) 249 days, 23:17:35.87
      SNMP-COMMUNITY-MIB::snmpTrapAddress.0 type=64 value=IpAddress: 10.81.0.3
      SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 type=4 value=STRING: "public"
      SNMPv2-MIB::snmpTrapEnterprise.0 type=6 value=OID: SNMPv2-SMI::enterprises.9.9.41.2


      trapperfile can receive snmptrap message but can't display on zabbix gui

      Comment

      Working...