Hello,
I can't be able to configure zabbix to receive snmp traps.
If I send a snmptrap:
snmptrap -v 1 -c public localhost .1.3.6.1.2.1.1.3 localhost i '' 1
and I do a echo in snmptrap.sh I get:
usr/bin/zabbix_sender localhost 10051 localhost:snmptraps localhost.localdomain 127.0.0.1 public SNMPv2-MIB::sysUpTime SNMPv2-MIB::coldStart
If I exute that line I get this error:
root@betazabbix:/tmp# zabbix_sender localhost 10051 localhost:snmptraps localhost.localdomain 127.0.0.1 public SNMPv2-MIB::sysUpTime SNMPv2-MIB::coldStart
ZABBIX send v1.1beta10 (19 Apr 2006)
usage: zabbix_sender [<Zabbix server> <port> <server> <key> <value>]
If no arguments are given, zabbix_sender expects list of parameters
from standard input.
root@betazabbix:/tmp#
If I execute this:
root@betazabbix:/tmp# zabbix_sender localhost 10051 localhost snmptraps test OK
root@betazabbix:/tmp#
I receive test in zabbix
Whatś 's happening?
This is my snmptrap.sh
# CONFIGURATION
ZABBIX_SERVER="localhost";
ZABBIX_PORT="10051";
ZABBIX_SENDER="usr/bin/zabbix_sender";
KEY="snmptraps";
HOST="localhost";
# 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"
echo $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str">/tmp/testtrap.txt
$ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str"
Thanks for your help!!!
Pablo
I can't be able to configure zabbix to receive snmp traps.
If I send a snmptrap:
snmptrap -v 1 -c public localhost .1.3.6.1.2.1.1.3 localhost i '' 1
and I do a echo in snmptrap.sh I get:
usr/bin/zabbix_sender localhost 10051 localhost:snmptraps localhost.localdomain 127.0.0.1 public SNMPv2-MIB::sysUpTime SNMPv2-MIB::coldStart
If I exute that line I get this error:
root@betazabbix:/tmp# zabbix_sender localhost 10051 localhost:snmptraps localhost.localdomain 127.0.0.1 public SNMPv2-MIB::sysUpTime SNMPv2-MIB::coldStart
ZABBIX send v1.1beta10 (19 Apr 2006)
usage: zabbix_sender [<Zabbix server> <port> <server> <key> <value>]
If no arguments are given, zabbix_sender expects list of parameters
from standard input.
root@betazabbix:/tmp#
If I execute this:
root@betazabbix:/tmp# zabbix_sender localhost 10051 localhost snmptraps test OK
root@betazabbix:/tmp#
I receive test in zabbix
Whatś 's happening?
This is my snmptrap.sh
# CONFIGURATION
ZABBIX_SERVER="localhost";
ZABBIX_PORT="10051";
ZABBIX_SENDER="usr/bin/zabbix_sender";
KEY="snmptraps";
HOST="localhost";
# 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"
echo $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str">/tmp/testtrap.txt
$ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str"
Thanks for your help!!!
Pablo
Comment