[syslog-ng]program driver only works once

David Schwendinger syslog-ng@lists.balabit.hu
Fri, 6 Aug 2004 14:47:37 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0040_01C47BC4.51116F00
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0041_01C47BC4.51116F00"


------=_NextPart_001_0041_01C47BC4.51116F00
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

All,

 

I have a program driver setup in the syslog-ng.conf file to execute a perl
script which sends an email with fixed content based on a syslog message.

 

This first time I run syslog-ng with the program driver, syslog-ng and the
script appear in a "ps -ef" listing as mentioned in the syslog-ng docs.:

 

"NOTE: the program is executed once at startup, and kept running until
SIGHUP or exit. The reason is to prevent starting up a large number of
programs for messages, which would imply an easy DoS."

 

The first time the conditions are met to send the email it works but the
script which was listed with syslog-ng in a "ps-ef" no longer appears in a
"ps -ef" and I can not seem to get it to start again.  "service syslog-ng
restart" or "stop" then "start" does not work.  Reboot does not work.

 

How can I get this script ready to send another alert after it has been
triggered?

 

The following are pertinent lines from the syslog-ng.conf file.

 

source s_sys { unix-stream("/dev/log"); internal(); };

 

destination d_mail-me { program("/etc/syslog-ng/test-mail.script"); }; 

 

filter f_filter9     { match("for user"); };

 

log { source(s_sys); filter(f_filter9); destination(d_mail-me); };

 

thanks,

David

 


------=_NextPart_001_0041_01C47BC4.51116F00
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>All,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I have a program driver setup in the syslog-ng.conf =
file to
execute a perl script which sends an email with fixed content based on a =
syslog
message.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>This first time I run syslog-ng with the program =
driver,
syslog-ng and the script appear in a &#8220;ps &#8211;ef&#8221; listing =
as
mentioned in the syslog-ng docs.:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&#8220;NOTE: the program is executed once at startup, =
and
kept running until SIGHUP or exit. The reason is to prevent starting up =
a large
number of programs for messages, which would imply an easy =
DoS.&#8221;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The first time the conditions are met to send the =
email it
works but the script which was listed with syslog-ng in a =
&#8220;ps-ef&#8221;
no longer appears in a &#8220;ps &#8211;ef&#8221; and I can not seem to =
get it
to start again. &nbsp;&#8220;service syslog-ng restart&#8221; or =
&#8220;stop&#8221;
then &#8220;start&#8221; does not work.&nbsp; Reboot does not =
work.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>How can I get this script ready to send another alert =
after
it has been triggered?<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>The following are pertinent lines from the =
syslog-ng.conf file.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>source s_sys {
unix-stream(&quot;/dev/log&quot;); internal(); =
};<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>destination d_mail-me {
program(&quot;/etc/syslog-ng/test-mail.script&quot;); =
};</span></font>&nbsp;<o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>filter =
f_filter9&nbsp;&nbsp;&nbsp;&nbsp; {
match(&quot;for user&quot;); };<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>log { =
source(s_sys);
filter(f_filter9); destination(d_mail-me); =
};<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>thanks,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>David</span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_001_0041_01C47BC4.51116F00--

------=_NextPart_000_0040_01C47BC4.51116F00
Content-Type: application/x-pkcs7-signature;
	name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="smime.p7s"

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKLDCCAj0w
ggGmAhEAzbp/VvDf5LxU/iKss3KqVTANBgkqhkiG9w0BAQIFADBfMQswCQYDVQQGEwJVUzEXMBUG
A1UEChMOVm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