<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h3
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:13.5pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=FR link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Why reinvent the weel. There
are many plug-in that adrress this need . <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Personally I use
check_logfiles <a href="http://www.consol.com/opensource/nagios/check-logfiles">http://www.consol.com/opensource/nagios/check-logfiles</a>
without any problem.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>there are many examples in
that website that can help you<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Best regards <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><b><font size=1 color="#d52022" face=Verdana><span
lang=EN-GB style='font-size:7.5pt;font-family:Verdana;color:#D52022;font-weight:
bold'>Dr Marouane HIMDI</span></font></b><font size=5 color=navy face=Verdana><span
lang=EN-GB style='font-size:16.0pt;font-family:Verdana;color:navy'><br>
</span></font><strong><span style='mso-bidi-theme-font: minor-bidi'><b><font
size=1 color="#020202" face=Verdana><span lang=EN-GB style='font-size:7.5pt;
font-family:Verdana;color:#020202'>Ingénieur R&D/R&D Engineer</span></span></font></b></strong><font
color=navy><span lang=EN-GB style='color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><strong><span style='mso-bidi-theme-font: minor-bidi'><b><font
size=1 color="#020202" face=Verdana><span lang=EN-GB style='font-size:7.5pt;
font-family:Verdana;color:#020202'><o:p> </o:p></span></font></b></strong></p>
</span>
<p class=MsoNormal><font size=3 color="#848587" face="Times New Roman"><span
style='font-size:12.0pt;color:#848587'><img border=0 width=100 height=48
id="_x0000_i1026" src="cid:image001.gif@01C9BF80.1C275A70"></span></font><font
size=2 color="#848587" face=Calibri><span lang=EN-GB style='font-size:10.0pt;
font-family:Calibri;color:#848587'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#646567" face=Verdana><span lang=EN-GB
style='font-size:7.5pt;font-family:Verdana;color:#646567'>KEREVAL<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#646567" face=Verdana><span lang=EN-GB
style='font-size:7.5pt;font-family:Verdana;color:#646567'>4, rue Hélène Boucher<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#646567" face=Verdana><span lang=EN-GB
style='font-size:7.5pt;font-family:Verdana;color:#646567'>Z.A</span></font><font
size=1 color="#646567" face=Verdana><span style='font-size:7.5pt;font-family:
Verdana;color:#646567'>. Bellevue<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#646567" face=Verdana><span
style='font-size:7.5pt;font-family:Verdana;color:#646567'>35235 Thorigné
Fouillard <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 color="#646567" face=Verdana><span lang=DE
style='font-size:7.5pt;font-family:Verdana;color:#646567'>Tel : +33 (0)2
23 20 36 64<br>
</span></font><b><font size=1 color="#646567" face=Verdana><span
style='font-size:7.5pt;font-family:Verdana;color:#646567;font-weight:bold'><a
href="http://www.kereval.com/" title="http://www.kereval.com"><font
color="#646567"><span lang=DE style='color:#646567'>http://www.kereval.com</span></font></a></span></font></b><font
size=1 color="#646567" face=Verdana><span lang=DE style='font-size:7.5pt;
font-family:Verdana;color:#646567'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Calibri><span style='font-size:
11.0pt;font-family:Calibri;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><em><i><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>P </span></font></i></em><font size=1
color=green face=Arial><span style='font-size:8.0pt;font-family:Arial;
color:green'>Pensez à l'environnement: n'imprimez ce message et ses pièces
jointes que si nécessaire !</span></font><o:p></o:p></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De :</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Gary Every
[mailto:gevery@gmail.com] <br>
<b><span style='font-weight:bold'>Envoyé :</span></b> vendredi 17 avril
2009 17:00<br>
<b><span style='font-weight:bold'>À :</span></b> kaouther mechri<br>
<b><span style='font-weight:bold'>Cc :</span></b>
Nagios-users@lists.sourceforge.net<br>
<b><span style='font-weight:bold'>Objet :</span></b> Re: [Nagios-users]
parsing log files on remote hosts</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>#!/bin/bash<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>LOGFILE="/tmp/logfile"<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>WORD="word_to_find"<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>GREP=/bin/grep<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>found=`$GREP -i $WORD $LOGFILE`<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>if [ -z $found ] ## $found is zero bytes<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>then<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> ok=1<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> RETSTRING=0 ## To be used for the exit code<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> LINE="No instances found"<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>else<br>
ok=0<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> RETSTRING=1<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> LINE=$found<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>fi<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>echo $LINE<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>exit $RETSTRING<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>## End of snippet<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Fri, Apr 17, 2009 at 7:35 AM, kaouther mechri <<a
href="mailto:kmechri@gmail.com">kmechri@gmail.com</a>> wrote:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hello All,<br>
<br>
I am seraching a way to parse some application log files on remote hosts
and grep for specific words, I need to add this as a nagios check. <br>
<br>
Can anyone help me <br>
kind regards<br>
<font color="#888888"><span style='color:#888888'>kaouther <br>
</span></font><br>
------------------------------------------------------------------------------<br>
Stay on top of everything new and different, both inside and<br>
around Java (TM) technology - register by April 22, and save<br>
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.<br>
300 plus technical and hands-on sessions. Register today.<br>
Use priority code J9JMT32. <a href="http://p.sf.net/sfu/p" target="_blank">http://p.sf.net/sfu/p</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br clear=all>
<br>
-- <br>
Gary Every<br>
"Pay it Forward!"<o:p></o:p></span></font></p>
</div>
</div>
</body>
</html>