Send SNMP events to Splunk Enterprise
Simple Network Management Protocol (SNMP) traps are alerts that remote devices send out. This topic describes how to receive and index SNMP traps at the Splunk Enterprise indexer.
The procedures in this topic (for both *nix and Windows) are examples only. You can accomplish the task of sending SNMP traps to Splunk Enterprise in a number of ways. For example, instead of using Net-SNMP, you can use other tools, such as Snare or SNMPGate, to write SNMP traps to file storage for monitoring by Splunk Enterprise.
For information on how to use Splunk Enterprise as a monitoring tool to send SNMP alerts to other systems, such as a Network Management System console, see Send SNMP traps to other systems in the Alerting manual.
How to index SNMP traps
The most effective way to index SNMP traps is to first write them to a file on the Splunk Enterprise server. Then, configure Splunk Enterprise to monitor the file.
To consume SNMP trap data:
1. Configure the remote devices to send their traps directly to the Splunk Enterprise instance IP address. The default port for SNMP traps is
2. Write the SNMP traps to a file on the Splunk Enterprise instance, as described in Write SNMP traps to a file on the Splunk Enterprise server.
3. Configure Splunk Enterprise to monitor the file, as described in Monitor files and directories.
Note: This topic does not cover SNMP polling, which is a way to query remote devices.
Write SNMP traps to a file on the Splunk Enterprise instance
On *nix, you can use the Net-SNMP project
snmptrapd binary to write SNMP traps to a file.
Before you install
snmptrapd on your system, see the local documentation for the version of
snmptrapd that comes with your distribution of *nix. See also the manual page for
The simplest configuration is:
# snmptrapd -Lf /var/log/snmp-traps
Note: Versions 5.3 and later of
snmptrapd apply access control checks to all incoming notifications instead of accepting and logging them automatically (even if no explicit configuration was provided). If you run
snmptrapd without suitable access control settings, then it does not process those traps. You can avoid this by specifying:
# snmptrapd -Lf /var/log/snmp-traps --disableAuthorization=yes
To see the version of
snmptrapd --version from the command prompt.
Troubleshoot problems with SNMP
If you experience problems sending SNMP traps to Splunk Enterprise, consider that:
- UDP port 162 is a privileged network port. If you need to use this port, then you must run
- You can use the
-fflag to keep
snmptrapdin the foreground while testing.
- You can use the
-Loflags instead of
-Lfto log to standard output.
- You can use the
snmptrapdcommand to generate an example trap, for example:
# snmptrap -v2c -c public localhost 1 1
To log SNMP traps to a file on Windows.
1. Download and install the latest version of
NET-SNMP for Windows from the NET-SNMP website.
Note: The OpenSSL library must not be installed on the system because it conflicts with NET-SNMP.
snmptrapd as a service using the script included in the
snmpTrapdAddr [System IP]:162 authCommunity log [community string]
4. The default log location is
Use Management Information Bases (MIBs)
Management Information Bases (MIBs) provide a map between numeric object IDs (OIDs) that the SNMP trap reports and a textual human readable form. Though
snmptrapd can work without any MIB files at all, it does not display the results in exactly the same way.
The vendor of the device you receive SNMP traps from can provide a specific MIB. For example, all Cisco device MIBs can be located using the online Cisco SNMP Object Navigator.
To add a new MIB file:
1. Download and copy the MIB file into the MIB search directory. On the *nix version of Net-SNMP, the default location is
/usr/local/share/snmp/mibs. You can set a different directory by providing the
-m argument to
snmptrapd to load the MIB(s) by passing a colon-separated list to the
- If you add a leading '+' character for the parameters in the
snmptrapdloads the MIB in addition to the default list, instead of overwriting the list.
- The special keyword
snmptrapdto load all MIB modules in the MIB directory.
For example, to load all MIB modules in the MIB directory:
snmptrapd -m +ALL
Get data from TCP and UDP ports
Considerations for deciding how to monitor remote Windows data
This documentation applies to the following versions of Splunk® Enterprise: 4.3, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.3.5, 4.3.6, 4.3.7, 5.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.10, 5.0.11, 5.0.12, 5.0.13, 5.0.14, 5.0.15, 5.0.16, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6, 6.2.7, 6.2.8, 6.2.9, 6.2.10, 6.2.11, 6.2.12, 6.3.0, 6.3.1, 6.3.2, 6.3.3, 6.3.4, 6.3.5, 6.3.6, 6.3.7