Transform::Alert::Input::SNMPTrapd - Transform alerts from an internal SNMP Trap daemon
# In your configuration <Input test> Type SNMPTrapd Interval 5 # you should set this to be very short # See Net::SNMPTrapd->new <ConnOpts> LocalAddr 192.168.1.1 LocalPort 514 # default # Timeout - don't bother </ConnOpts> # <Template> tags... </Input>
This input type will spawn a SNMP trap listener and process each trap through the input template engine. If it finds a match, the results of the match are sent to one or more outputs, depending on the group configuration.
See Net::SNMPTrapd for a list of the ConnOpts section parameters. The Timeout parameter is basically ignored, since get_trap calls will use a timeout of 0 (ie: instant). This is so that the main daemon doesn't bother waiting for messages during each heartbeat. As such, the Interval setting should be set very low. (But, not zero; that would be unwise...)
Timeout
get_trap
Interval
$addr:$port - $datagram
{ remoteaddr => $str, remoteport => $int, version => $int, # 1 = SNMPv1, 2 = SNMPv2c community => $str, pdu_type => $str, # text version varbinds => [ [{ $OID => $value }], [{ $OID => $value }], # ... ], # SNMPv1 only ent_OID => $str, agentaddr => $str, generic_trap => $str, # text version specific_trap => $str, timeticks => $int, # SNMPv2 only request_ID => $str, error_status => $str, error_index => $int, }
Admittedly, the datagram of a SNMP trap isn't all that useful, so the text version is somewhat useless...
The project homepage is https://github.com/SineSwiper/Transform-Alert/wiki.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see https://metacpan.org/module/Transform::Alert/.
Brendan Byrd <BBYRD@CPAN.org>
This software is Copyright (c) 2013 by Brendan Byrd.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Transform::Alert, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Transform::Alert
CPAN shell
perl -MCPAN -e shell install Transform::Alert
For more information on module installation, please visit the detailed CPAN module installation guide.