Ad Widget

Collapse

SNMP Traps shows <UNKNOWN>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sharafy
    Junior Member
    • May 2012
    • 15

    #1

    SNMP Traps shows <UNKNOWN>

    Hi,

    I setup Zabbix snmp trap and host name shows up as <UNKNOWN> under "Latest Data"

    Code:
    # snmptrap -Ci -v 2c -c public localhost "" "NET-SNMP-MIB::netSnmpExperimental" NET-SNMP-MIB::netSnmpExperimental s "test15"
    Outcome:

    Code:
    2012.Oct.15 17:22:31	<UNKNOWN> "test15" NET-SNMP-MIB::netSnmpExperimental
    I have created a host called snmptraps with ip 127.0.0.1 and assigned the following item to the host:

    Name: snmptraps
    Type: Zabbix Trapper
    Key: snmptraps
    Type of information: Character

    Any snmp traps that I sent to Zabbix shows up as <UNKNOWN>. Can someone help me with this please?

    Zabbix Version: 2.0.3

    snmptrap.sh:

    Code:
    ZABBIX_SERVER="localhost";
    ZABBIX_PORT="10051";
    
    ZABBIX_SENDER="/usr/local/bin/zabbix_sender";
    
    KEY="snmptraps";
    HOST="snmptraps";
    
    # END OF CONFIGURATION
    
    read hostname
    read ip
    read uptime
    read oid
    read address
    read community
    read enterprise
    
    oid=`echo $oid|cut -f2 -d' '`
    address=`echo $address|cut -f2- -d' '`
    community=`echo $community|cut -f2 -d' '`
    enterprise=`echo $enterprise|cut -f2 -d' '`
    
    oid=`echo $oid|cut -f11 -d'.'`
    community=`echo $community|cut -f2 -d'"'`
    
    str="$hostname $address $community $enterprise $oid"
    
    $ZABBIX_SENDER -z $ZABBIX_SERVER -p $ZABBIX_PORT -s $HOST -k $KEY -o "$str"
    Thanks.
  • sharafy
    Junior Member
    • May 2012
    • 15

    #2
    It seems that I was starting the snmptrapd incorrectly.

    I had to start snmptrapd with -n flag to avoid doing a reverse lookup on received traps and now I get the actual IP instead of <UNKNOWN>.

    I'm running Net-SNMP 5.7.1

    Comment

    Working...