xymon blank alert emails
Hi Team.
I am writing to regarding an facing issue which we are facing after configuring xymon XYMON is working fine and alerts are getting displayed , but the same are being sent in email but subject, body is blank as given in end of email I have given alerts.cfg as below. * * *HOST=* SERVICE=ssh,disk,msg,sap_r3,oratns COLOR=red DURATION>2m* *SCRIPT /home/sapxymon/server/etc/custom_alert.sh REPEAT=1m*
. Wheres the custom_alerts.sh give below syntax error.
#----------------------------------------------------- #!/bin/sh
BBALPHAMSG=echo "$BBALPHAMSG" | /home/sapxymon/server/ext/custom_grep.pl;export
BBALPHAMSG
if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi
#echo "${BBALPHAMSG:0:9999}" > /tmp/manalerts.txt echo "${BBALPHAMSG:0:9999}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG"nc.sonal at gmail.com
#----------------------------------------------------- #!/usr/bin/perl
searching for lines which has "&red"
while (<>) {
@matches=/&red .*\s/ig;
foreach $_ (@matches) { s/<.*?>//ig; # removing all the html tags print "$_ "; }
} #-----------------------------------------------------
Could you please suggest what could be the issue?
*---------- Forwarded message ---------- From: SAP-XY-MON <sapxymon at sasapmon.sasrv.biz> Date: Mon, Feb 20, 2012 at 7:00 PM Subject: - To: nc.sonal at gmail.com
-- Thanks & Regards Sonal kumar N C
Can't tell if the problem's with xymon or your grep. Try using a debug script something like the below, just to see what you're getting in all the variables.
cat /usr/local/scripts/mailxy
#!/bin/bash echo $BBALPHAMSG >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo "available information" >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo " BB is $BB " >> /tmp/msg.$$ echo " BBCOLORLEVEL is $BBCOLORLEVEL " >> /tmp/msg.$$ echo " ACKCODE is $ACKCODE " >> /tmp/msg.$$ echo " RCPT is $RCPT " >> /tmp/msg.$$ echo " BBHOSTNAME is $BBHOSTNAME " >> /tmp/msg.$$ echo " MACHIP is $MACHIP " >> /tmp/msg.$$ echo " BBSVCNAME is $BBSVCNAME " >> /tmp/msg.$$ echo " BBSVCNUM is $BBSVCNUM " >> /tmp/msg.$$ echo " BBHOSTSVC is $BBHOSTSVC " >> /tmp/msg.$$ echo " BBHOSTSVCCOMMAS is $BBHOSTSVCCOMMAS " >> /tmp/msg.$$ echo " BBNUMERIC is $BBNUMERIC " >> /tmp/msg.$$ echo " RECOVERED is $RECOVERED " >> /tmp/msg.$$ echo " DOWNSECS is $DOWNSECS " >> /tmp/msg.$$ echo " DOWNSECSMSG is $DOWNSECSMSG " >> /tmp/msg.$$ echo " BBALPHAMSG is $BBALPHAMSG " >> /tmp/msg.$$
/bin/mailx -s "$BBHOSTSVC $BBCOLORLEVEL" $RCPT < /tmp/msg.$$ rm /tmp/msg.$$
Hi,
I tried executing the below script, but it doesnot collect any info in those variables..
available information
BB is BBCOLORLEVEL is ACKCODE is RCPT is BBHOSTNAME is MACHIP is BBSVCNAME is BBSVCNUM is BBHOSTSVC is BBHOSTSVCCOMMAS is BBNUMERIC is RECOVERED is DOWNSECS is DOWNSECSMSG is BBALPHAMSG is ~ ~
On Tue, Feb 21, 2012 at 2:02 AM, Elizabeth Schwartz < betsy.schwartz at gmail.com> wrote:
Can't tell if the problem's with xymon or your grep. Try using a debug script something like the below, just to see what you're getting in all the variables.
cat /usr/local/scripts/mailxy
#!/bin/bash echo $BBALPHAMSG >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo "available information" >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo " BB is $BB " >> /tmp/msg.$$ echo " BBCOLORLEVEL is $BBCOLORLEVEL " >> /tmp/msg.$$ echo " ACKCODE is $ACKCODE " >> /tmp/msg.$$ echo " RCPT is $RCPT " >> /tmp/msg.$$ echo " BBHOSTNAME is $BBHOSTNAME " >> /tmp/msg.$$ echo " MACHIP is $MACHIP " >> /tmp/msg.$$ echo " BBSVCNAME is $BBSVCNAME " >> /tmp/msg.$$ echo " BBSVCNUM is $BBSVCNUM " >> /tmp/msg.$$ echo " BBHOSTSVC is $BBHOSTSVC " >> /tmp/msg.$$ echo " BBHOSTSVCCOMMAS is $BBHOSTSVCCOMMAS " >> /tmp/msg.$$ echo " BBNUMERIC is $BBNUMERIC " >> /tmp/msg.$$ echo " RECOVERED is $RECOVERED " >> /tmp/msg.$$ echo " DOWNSECS is $DOWNSECS " >> /tmp/msg.$$ echo " DOWNSECSMSG is $DOWNSECSMSG " >> /tmp/msg.$$ echo " BBALPHAMSG is $BBALPHAMSG " >> /tmp/msg.$$
/bin/mailx -s "$BBHOSTSVC $BBCOLORLEVEL" $RCPT < /tmp/msg.$$ rm /tmp/msg.$$
-- Thanks & Regards Sonal kumar N C
How are you calling it in alerts.cfg? and what version of xymon?
On Tue, Feb 21, 2012 at 1:33 PM, sonal kumar <nc.sonal at gmail.com> wrote:
Hi,
I tried executing the below script, but it doesnot collect any info in those variables..
available information
BB is BBCOLORLEVEL is ACKCODE is RCPT is BBHOSTNAME is MACHIP is BBSVCNAME is BBSVCNUM is BBHOSTSVC is BBHOSTSVCCOMMAS is BBNUMERIC is RECOVERED is DOWNSECS is DOWNSECSMSG is BBALPHAMSG is ~ ~
On Tue, Feb 21, 2012 at 2:02 AM, Elizabeth Schwartz <betsy.schwartz at gmail.com> wrote:
Can't tell if the problem's with xymon or your grep. Try using a debug script something like the below, just to see what you're getting in all the variables.
cat /usr/local/scripts/mailxy
#!/bin/bash echo $BBALPHAMSG >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo "available information" >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo " BB is $BB " >> /tmp/msg.$$ echo " BBCOLORLEVEL is $BBCOLORLEVEL " >> /tmp/msg.$$ echo " ACKCODE is $ACKCODE " >> /tmp/msg.$$ echo " RCPT is $RCPT " >> /tmp/msg.$$ echo " BBHOSTNAME is $BBHOSTNAME " >> /tmp/msg.$$ echo " MACHIP is $MACHIP " >> /tmp/msg.$$ echo " BBSVCNAME is $BBSVCNAME " >> /tmp/msg.$$ echo " BBSVCNUM is $BBSVCNUM " >> /tmp/msg.$$ echo " BBHOSTSVC is $BBHOSTSVC " >> /tmp/msg.$$ echo " BBHOSTSVCCOMMAS is $BBHOSTSVCCOMMAS " >> /tmp/msg.$$ echo " BBNUMERIC is $BBNUMERIC " >> /tmp/msg.$$ echo " RECOVERED is $RECOVERED " >> /tmp/msg.$$ echo " DOWNSECS is $DOWNSECS " >> /tmp/msg.$$ echo " DOWNSECSMSG is $DOWNSECSMSG " >> /tmp/msg.$$ echo " BBALPHAMSG is $BBALPHAMSG " >> /tmp/msg.$$
/bin/mailx -s "$BBHOSTSVC $BBCOLORLEVEL" $RCPT < /tmp/msg.$$ rm /tmp/msg.$$
-- Thanks & Regards Sonal kumar N C
Hi. Just joined here. Trying to get our new Xymon Unix server to show the basic parameters from monitoring like CPU, Disk, Memory.
It's only showing Conn, http, info, and trends.
Regards,
Don K
Hi,
We are giving the below script command in alerts.cfg
HOST=* SERVICE=ssh,disk,msg,sap_r3,oratns COLOR=red DURATION>2m SCRIPT /home/sapxymon/server/etc/custom_alert.sh REPEAT=1m #-----------------------------------------------------
and again custom_alert.sh runs the custom_grep.pl
#----------------------------------------------------- #!/bin/sh
BBALPHAMSG=echo "$BBALPHAMSG" | /home/sapxymon/server/ext/custom_grep.pl;export
BBALPHAMSG
if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi
echo "${BBALPHAMSG:0:9999}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" nc.sonal at gmail.com
We are using Version 4.3.2
On Sat, Feb 25, 2012 at 2:57 AM, Elizabeth Schwartz < betsy.schwartz at gmail.com> wrote:
How are you calling it in alerts.cfg? and what version of xymon?
On Tue, Feb 21, 2012 at 1:33 PM, sonal kumar <nc.sonal at gmail.com> wrote:
Hi,
I tried executing the below script, but it doesnot collect any info in those variables..
available information
BB is BBCOLORLEVEL is ACKCODE is RCPT is BBHOSTNAME is MACHIP is BBSVCNAME is BBSVCNUM is BBHOSTSVC is BBHOSTSVCCOMMAS is BBNUMERIC is RECOVERED is DOWNSECS is DOWNSECSMSG is BBALPHAMSG is ~ ~
On Tue, Feb 21, 2012 at 2:02 AM, Elizabeth Schwartz <betsy.schwartz at gmail.com> wrote:
Can't tell if the problem's with xymon or your grep. Try using a debug script something like the below, just to see what you're getting in all the variables.
cat /usr/local/scripts/mailxy
#!/bin/bash echo $BBALPHAMSG >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo "available information" >> /tmp/msg.$$ echo " " >>/tmp/msg.$$ echo " BB is $BB " >> /tmp/msg.$$ echo " BBCOLORLEVEL is $BBCOLORLEVEL " >> /tmp/msg.$$ echo " ACKCODE is $ACKCODE " >> /tmp/msg.$$ echo " RCPT is $RCPT " >> /tmp/msg.$$ echo " BBHOSTNAME is $BBHOSTNAME " >> /tmp/msg.$$ echo " MACHIP is $MACHIP " >> /tmp/msg.$$ echo " BBSVCNAME is $BBSVCNAME " >> /tmp/msg.$$ echo " BBSVCNUM is $BBSVCNUM " >> /tmp/msg.$$ echo " BBHOSTSVC is $BBHOSTSVC " >> /tmp/msg.$$ echo " BBHOSTSVCCOMMAS is $BBHOSTSVCCOMMAS " >> /tmp/msg.$$ echo " BBNUMERIC is $BBNUMERIC " >> /tmp/msg.$$ echo " RECOVERED is $RECOVERED " >> /tmp/msg.$$ echo " DOWNSECS is $DOWNSECS " >> /tmp/msg.$$ echo " DOWNSECSMSG is $DOWNSECSMSG " >> /tmp/msg.$$ echo " BBALPHAMSG is $BBALPHAMSG " >> /tmp/msg.$$
/bin/mailx -s "$BBHOSTSVC $BBCOLORLEVEL" $RCPT < /tmp/msg.$$ rm /tmp/msg.$$
-- Thanks & Regards Sonal kumar N C
-- Thanks & Regards Sonal kumar N C
participants (3)
-
betsy.schwartz@gmail.com
-
Don.Kuhlman@schawk.com
-
nc.sonal@gmail.com