From ad55b12ac9e9162c2fff77072ab3d56e4637c788 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 11 Feb 2008 14:50:25 +0000 Subject: Fixed minor bug finalize_it, pdu only needs to be cleaned if snmp_send failed. Also added documentation to the omsnmp module. --- doc/omsnmp.html | 118 ++++++++++++++++++++++++++++++++++++++++++++---- plugins/omsnmp/omsnmp.c | 3 ++ 2 files changed, 113 insertions(+), 8 deletions(-) diff --git a/doc/omsnmp.html b/doc/omsnmp.html index 7378ad72..2c9d16f8 100644 --- a/doc/omsnmp.html +++ b/doc/omsnmp.html @@ -1,7 +1,7 @@ - + - + Understanding rsyslog queues @@ -10,20 +10,122 @@

SNMP Output Module

Module Name:    omsnmp

Description:

-

Provides the ability to send SNMPv1 & v2 traps.

-

...

+

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, by default with the OID i.o.d.internet.private.enterprises. +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.

+

 

Action Line:

%omsnmp% without any further parameters.

+

 

Configuration Directives:

+

 

Caveats/Known Bugs:

Sample:

The following commands send every message as a snmp trap.

- diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index cd3d589a..c559dbc8 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -250,10 +250,13 @@ static rsRetVal omsnmp_sendsnmp(instanceData *pData, uchar *psz) /* TODO! CLEANUP */ ABORT_FINALIZE(RS_RET_ERR); } + else /* Reset pdu Pointer, already cleaned */ + pdu = NULL; finalize_it: if(pdu != NULL) { snmp_free_pdu(pdu); + dbgprintf( "omsnmp_sendsnmp: called snmp_free_pdu - manually freeing memory for pdu\n"); } if(ss != NULL) { -- cgit