On Wed, 9 Feb 2011, Mark Olliver wrote:
Hi,
Is there any documentation on omprog as i can not find anything other
than a few lines in the mailing list and my C source reading is not
great.
So far the following works to trigger my script but is there a way to
send the contents of the msg and or any custom arguments that my
script might want?
$ModLoad omprog
$actionomprogbinary /usr/bin/alert1
if $programname == 'FILLER' then :omprog:
does your script check both it's stdin and command-line parameters? I
would expect that the log line would be passed through one of those (and
could then be modified with a ;format_name added to the line that calls
the script)
I haven't worked with omfile yet myself.
a second option that you have (especially if you want the script to send
one mail for several log messages), is to have rsyslog write to a named
pipe, and then have your alert script read from that pipe (so it can see
multiple messages) and send out the mail from within the script instead of
sending out one mail per script invocation.
David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com