omsnmp: SNMP Trap Output Module

Module Name:

omsnmp

Author:

Andre Lorbach <alorbach@adiscon.com>

Purpose

Provides the ability to send syslog messages as an SNMPv1 & v2c traps. By default, SNMPv2c is preferred. The syslog message is wrapped into a OCTED STRING variable. This module uses the NET-SNMP library. In order to compile this module, you will need to have the NET-SNMP developer (headers) package installed.

Configuration Parameters

Note

Parameter names are case-insensitive; camelCase is recommended for readability.

Action Parameters

Parameter

Summary

Server

Defines the SNMP target host by hostname or IP address.

Port

Specifies the port used for sending SNMP traps.

Transport

Selects the transport protocol for SNMP communication.

Version

Chooses whether SNMPv1 or SNMPv2c traps are sent.

Community

Sets the SNMP community string.

TrapOID

Defines the notification OID used for SNMPv2 traps.

MessageOID

Specifies the OID for the message variable carrying the syslog text.

EnterpriseOID

Specifies the enterprise OID used in SNMPv1 traps.

SpecificType

Defines the SNMPv1 specific trap number.

Snmpv1DynSource

Overrides the SNMPv1 trap source address via template.

TrapType

Selects the SNMPv1 generic trap type.

Caveats/Known Bugs

  • In order to decode the custom OIDs, you will need to have the adiscon mibs installed.

Examples

Sending messages as snmp traps

The following commands send every message as a snmp trap.

module(load="omsnmp")
action(type="omsnmp" server="localhost" port="162" transport="udp"
       version="1" community="public")

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.