[syslog-ng]sending snmptraps w/ snmptrap
Aaron Jackson
syslog-ng@lists.balabit.hu
Tue, 23 Sep 2003 10:52:11 -0400
Why don't you use a template with the "program" destination?
destination traps { program("/usr/local/sbin/sendtrap.sh" =20
template('$HOST' '$FACILITY' '$PRIORITY' ... '$MSG'); }
You just have to parse the command line arguments properly.
On Tuesday, September 23, 2003, at 03:57 AM, MGruber@metzler.com wrote:
> Hi!
>
> I am trying to send an snmptrap if a critical or error-Message =
occures.
> I found some scripts in the net which told me to use
>
> destination traps {program("/usr/local/sbin/sendtrap.sh"); };
> with following script
> #!/bin/sh
> while read line; do
> snmptrap ....
> done
>
> It has the problem that I can not manipulate the snmptrap statement, =20=
> I tried
> further:
>
> destination d_send_trap {
> pipe("/tmp/snmptrap.pipe"
> template("snmptrap ..... '$HOST' '$FACILITY' '$PRIORITY' ... =20=
> '$MSG'\n")
> template-escape(yes));
>
> now I have the trouble how I get the statement from the pipe into =20
> execution.
>
> Does anyone have something in this kind working ?
>
> Thanks in advance
> Matthias Gruber
>
> =
-----------------------------------------------------------------------=20=
> -------------
>
> Dipl.-Inform. Matthias Gruber
> MCNE(mult.), MCSE, CIP, IT-Project+
> Bankhaus B. Metzler seel. Sohn & Co. KGaA
> ++ Informationssysteme/Systemtechnik ++
> Tel.: +49 69 2104 4330
> Fax: +49 69 2104 4040
> Gro=DFe Gallusstr. 18
> 60311 Frankfurt
> MGruber@Metzler.com
>
>
> _______________________________________________
> syslog-ng maillist - syslog-ng@lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Frequently asked questions at http://www.campin.net/syslog-ng/faq.html