Hi, <div><br></div><div>We are giving the below script command in alerts.cfg</div><div><br></div><div><div>HOST=* SERVICE=ssh,disk,msg,sap_r3,oratns COLOR=red DURATION>2m</div><div>SCRIPT /home/sapxymon/server/etc/custom_alert.sh REPEAT=1m</div>
<div>#-----------------------------------------------------</div><div><br></div><div>and again custom_alert.sh runs the <a href="http://custom_grep.pl">custom_grep.pl</a></div><div><br></div><div><div>#-----------------------------------------------------</div>
<div>#!/bin/sh</div><div><br></div><div>BBALPHAMSG=`echo "$BBALPHAMSG" | /home/sapxymon/server/ext/<a href="http://custom_grep.pl">custom_grep.pl</a>`;export BBALPHAMSG</div><div><br></div><div>if [ $RECOVERED -eq 1 ]</div>
<div>        then</div><div>        RECOVERED="recovered"</div><div>       else</div><div>        RECOVERED=""</div><div>fi</div><div><br></div><div>echo "${BBALPHAMSG:0:9999}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" <a href="mailto:nc.sonal@gmail.com">nc.sonal@gmail.com</a></div>
</div><div><br></div>We are using  Version 4.3.2</div><div><br><div class="gmail_quote">On Sat, Feb 25, 2012 at 2:57 AM, Elizabeth Schwartz <span dir="ltr"><<a href="mailto:betsy.schwartz@gmail.com">betsy.schwartz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How are you calling it in alerts.cfg?<br>
and what version of xymon?<br>
<div><div></div><div class="h5"><br>
On Tue, Feb 21, 2012 at 1:33 PM, sonal kumar <<a href="mailto:nc.sonal@gmail.com">nc.sonal@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I tried executing the below script, but it doesnot collect any info in those<br>
> variables..<br>
><br>
><br>
><br>
> available information<br>
><br>
>  BB is<br>
>  BBCOLORLEVEL is<br>
>  ACKCODE is<br>
>  RCPT is<br>
>  BBHOSTNAME is<br>
>  MACHIP is<br>
>  BBSVCNAME is<br>
>  BBSVCNUM is<br>
>  BBHOSTSVC is<br>
>  BBHOSTSVCCOMMAS is<br>
>  BBNUMERIC is<br>
>  RECOVERED is<br>
>  DOWNSECS is<br>
>  DOWNSECSMSG is<br>
>  BBALPHAMSG is<br>
> ~<br>
> ~<br>
><br>
><br>
> On Tue, Feb 21, 2012 at 2:02 AM, Elizabeth Schwartz<br>
> <<a href="mailto:betsy.schwartz@gmail.com">betsy.schwartz@gmail.com</a>> wrote:<br>
>><br>
>> Can't tell if the problem's with xymon or your grep. Try using a debug<br>
>> script something like the below, just to see what you're getting in<br>
>> all the variables.<br>
>><br>
>> cat /usr/local/scripts/mailxy<br>
>><br>
>><br>
>> #!/bin/bash<br>
>> echo  $BBALPHAMSG  >> /tmp/msg.$$<br>
>> echo " " >>/tmp/msg.$$<br>
>> echo "available information" >> /tmp/msg.$$<br>
>> echo " " >>/tmp/msg.$$<br>
>> echo " BB is $BB " >> /tmp/msg.$$<br>
>> echo " BBCOLORLEVEL is $BBCOLORLEVEL " >> /tmp/msg.$$<br>
>> echo " ACKCODE is $ACKCODE " >> /tmp/msg.$$<br>
>> echo " RCPT is $RCPT " >> /tmp/msg.$$<br>
>> echo " BBHOSTNAME is $BBHOSTNAME " >> /tmp/msg.$$<br>
>> echo " MACHIP is $MACHIP " >> /tmp/msg.$$<br>
>> echo " BBSVCNAME is $BBSVCNAME " >> /tmp/msg.$$<br>
>> echo " BBSVCNUM is $BBSVCNUM " >> /tmp/msg.$$<br>
>> echo " BBHOSTSVC is $BBHOSTSVC   " >> /tmp/msg.$$<br>
>> echo " BBHOSTSVCCOMMAS is $BBHOSTSVCCOMMAS " >> /tmp/msg.$$<br>
>> echo " BBNUMERIC is $BBNUMERIC   " >> /tmp/msg.$$<br>
>> echo " RECOVERED is $RECOVERED   " >> /tmp/msg.$$<br>
>> echo " DOWNSECS is $DOWNSECS     " >> /tmp/msg.$$<br>
>> echo " DOWNSECSMSG is $DOWNSECSMSG " >> /tmp/msg.$$<br>
>> echo " BBALPHAMSG is $BBALPHAMSG " >> /tmp/msg.$$<br>
>><br>
>><br>
>> /bin/mailx -s "$BBHOSTSVC $BBCOLORLEVEL" $RCPT < /tmp/msg.$$<br>
>> rm /tmp/msg.$$<br>
><br>
><br>
><br>
><br>
> --<br>
> Thanks & Regards<br>
> Sonal kumar N C<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks & Regards<br>Sonal kumar N C<br><br>
</div>