NetSNMPd Snmptt Trap Server

From Observium

Jump to: navigation, search


Currently doesn't really do anything!

Install the trap handler snmptt

aptitude install snmptt

/etc/default/snmpd

TRAPDRUN=yes
TRAPDOPTS='-On -Lsd -p /var/run/snmptrapd.pid'

/etc/snmp/snmptrapd.conf

traphandle default /usr/sbin/snmptt
disableAuthorization yes

/etc/snmptt.ini

[General]
snmptt_system_name =
mode = standalone
multiple_event = 1
dns_enable = 0
strip_domain = 0
strip_domain_list = 
resolve_value_ip_addresses = 0
net_snmp_perl_enable = 1
net_snmp_perl_best_guess = 0
translate_log_trap_oid = 1
translate_value_oids = 1
translate_enterprise_oid_format = 1
translate_trap_oid_format = 1
translate_varname_oid_format = 1
translate_integers = 1
mibs_environment = ALL
wildcard_expansion_separator = " "
allow_unsafe_regex = 0
remove_backslash_from_quotes = 0
dynamic_nodes = 0
description_mode = 0
description_clean = 1
threads_enable = 0
threads_max = 10
[DaemonMode]
daemon_fork = 1
daemon_uid = snmp
pid_file = /var/run/snmptt.pid
spool_directory = /var/spool/snmptt/
sleep = 5
use_trap_time = 1
keep_unlogged_traps = 1
[Logging]
stdout_enable = 0
log_enable = 1
log_file = /var/log/snmptt.log
log_system_enable = 0
log_system_file = /var/log/snmpttsystem.log
unknown_trap_log_enable = 0
unknown_trap_log_file = /var/log/snmpttunknown.log
statistics_interval = 0
syslog_enable = 1
syslog_facility = local0
syslog_level = warning
syslog_system_enable = 1
syslog_system_facility = local0
syslog_system_level = warning
[Exec]
exec_enable = 1
pre_exec_enable = 1
unknown_trap_exec =
unknown_trap_exec_format =
exec_escape = 1
[Debugging]
DEBUGGING = 2
DEBUGGING_FILE = /tmp/snmptt.debug
DEBUGGING_FILE_HANDLER =
[TrapFiles]
snmptt_conf_files = <<END
/etc/snmp/snmptt.conf
END 

/etc/snmp/snmptt.conf (replace /home/observium/demo/ with your install dir)

#
#
#
EVENT linkDown .1.3.6.1.6.3.1.1.5.3 "Status Events" Normal
FORMAT Link down on interface $1.  Admin state: $2.  Operational state: $3
EXEC /home/observium/demo/snmptrap.php "$A,linkDown,$1,$2,$3" >>/dev/null
SDESC
A linkDown trap signifies that the SNMP entity, acting in
an agent role, has detected that the ifOperStatus object for
one of its communication links is about to enter the down
state from some other state (but not from the notPresent
state).  This other state is indicated by the included value
of ifOperStatus.
EDESC
#
#
#
EVENT linkUp .1.3.6.1.6.3.1.1.5.4 "Status Events" Normal
FORMAT Link up on interface $1.  Admin state: $2.  Operational state: $3
EXEC /home/observium/demo/snmptrap.php "$A,linkUp,$1,$2,$3" >>/dev/null
SDESC
A linkUp trap signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus object for
one of its communication links left the down state and
transitioned into some other state (but not into the
notPresent state).  This other state is indicated by the
included value of ifOperStatus.
EDESC
#
#
#
EVENT cieLinkDown .1.3.6.1.4.1.9.9.276.0.1 "Status Events" Normal
FORMAT A cisco specific linkDown notification $*
EXEC /home/observium/demo/snmptrap.php "$A,linkDown,$1,$2,$3" >>/dev/null
SDESC
A cisco specific linkDown notification
signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus
object for one of its communication links is
about to enter the down state from some other
state (but not from the notPresent state).
The varbinds for this notification indicate the
interface information of the communication
link.
Variables:
  1: ifIndex
  2: ifAdminStatus
  3: ifOperStatus
  4: ifName
  5: ifType
EDESC
#
#
#
EVENT cieLinkUp .1.3.6.1.4.1.9.9.276.0.2 "Status Events" Normal
FORMAT A cisco specific linkUp trap signifies that $*
EXEC /home/observium/demo/snmptrap.php "$A,linkUp,$1,$2,$3" >>/dev/null
SDESC
A cisco specific linkUp trap signifies that
the SNMP entity, acting in an agent role, has
detected that the ifOperStatus object for one
of its communication links left the down state
and transitioned into some other state (but not
into the notPresent state). The varbinds for
this notification indicate the interface
information of the communication link.
Variables:
  1: ifIndex
  2: ifAdminStatus
  3: ifOperStatus
  4: ifName
  5: ifType
EDESC