Alternate script, processes traps and uses the trap OID in complete numerical format as the key ID. Using this you can have have traps individually per host, and thus set up triggers per hosts trap.
That script in it's current form also connects to the MySQL database Zabbix is using, in order to verify the host exists, and the OID exists as an item for that host. You could of course remove this for a little added performance.
Two arrays exist in order to filter out traps, either discard based on string values or trap OID.
@discard_strings = ("Virtual-Access");
@discard_oids = (".1.3.6.1.3.118.0.2");
Yes you can do that in snmptrapd.conf, but at the moment I'd prefer to receive everything.
You may also wish to remove the debugging output stuff. I've left it in for the time being because I'm still working on this. I'm releasing the script now so others can use it and improve it.
Comments please ?
[root@punk zabbix]# cat /etc/snmp/snmptrapd.conf
# /etc/snmp/snmptrapd.conf
traphandle default /usr/lib/zabbix/snmptrap.pl
dontRetainLogs true
# EOF
Comment