[syslog-ng]Re: Syslog-ng and SNMP traps

Balazs Scheidler bazsi@balabit.hu
Wed, 6 Dec 2000 13:38:42 +0100


> Sorry if this is  a stupid question.
> As I don't know many things about SNMP
> by reading the documentation for syslog-ng
> I didn't understand whether syslog-ng
> can actually send SNMP traps or not.
> If it does, how does it do it?

syslog-ng by itself cannot send SNMP traps, but you can extend it with a
small program which can. For example:

source src { unix-stream("/dev/log"); internal(); };
destination traps { program("/usr/local/sbin/sendtraps"); };
log { source(src); destination(traps); };

And /usr/local/sbin/sendtraps contains:

#!/bin/sh
while read line; do
	snmptrap ...
done

of course you might need to filter messages going out as traps.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt