In NET-SNMP land, the general idea of a "threshold trap" is done using the DisMan Event MIB. Since I have NET-SNMP, and it is thoroughly documented in the world, I'm going to lean heavily on a couple of references. So, how you go about this part may vary from agent to agent. For most SNMP agents, the idea of "sending based on a threshold" is not a common concept. But, it is also the "least Splunkadelic" part of the question. This is where it actually gets interesting. I'll go with nf because that's how I roll. So, this should be as simple as adding a Data input in the Splunk UI, or editing nf directly.
If your trap didn't make it, then you should be looking at things like firewalls and so forth in order to debug the issue. SNMPv2-SMI::snmpModules Cold Start Trap (0) Uptime: 0:00:00.00 Now we do a simple test to see if another host (my Mac) can send an arbitrary trap and have it show up in the log. We can now do a service snmptrapd start and see the daemon start, and see it log a little intro line to the snmptrapd.log file: log]# tail -f snmptrapd.logĬreated directory: /var/lib/net-snmp/mib_indexes OPTIONS="-A -Lf /var/log/snmptrapd.log -p /var/run/snmptrapd.pid" # OPTIONS="-Lsd -p /var/run/snmptrapd.pid" # traphandle SNMPv2-MIB::coldStart /usr/bin/bin/my_great_script coldĪnd in /etc/sysconfig/snmptrapd: # snmptrapd command line options # No traps are handled by default, you must edit this file! In /etc/snmp/nf: # Example configuration file for snmptrapd
#Snmp trap receiver linux centos install
sudo yum install -y net-snmp net-snmp-utils We start by making sure Net-SNMP is installed. I'll use my CentOS 6.2 box as a guinea pig here. Configure Splunk to be able to monitor snmptrapd's log file and see it get indexed.Make a server able to send ANY trap successfully to snmptrapd.Configure snmptrapd to receive traps and write them to a logfile.So given the decision to use the native snmptrapd then our list of steps gets refined a little. MIBS are suddenly orders of magnitude easier to deal with, because we're not fooling with the obtuse (or is it abstruse?) MIB format that pySNMP uses.
Similar to syslog, the snmptrapd daemon will need to be restarted far less often than Splunk and it will restart orders of magnitude faster.