customize the email body alerts for xymon
list Sonal Kumar
Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C
list Gatis A.
Hi,
Quick and dirty solution to get &red lines to be sent out only (tested with
xymon 4.2.2)
Basicly $BBALPHAMSG variable is the key here!
hobbit-alerts.cfg:
#-----------------------------------------------------
GROUP=TESTGROUP
SCRIPT /path/to/custom_alerts.sh user-3a7b9bbe2bfd@xymon.invalid
#-----------------------------------------------------
custom_alerts.sh:
#-----------------------------------------------------
#!/bin/bash
BBALPHAMSG=`echo "$BBALPHAMSG" | /path/to/custom_grep.pl`;export BBALPHAMSG
if [ $RECOVERED -eq 1 ]
then
RECOVERED="recovered"
else
RECOVERED=""
fi
echo "${BBALPHAMSG:0:300}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL
$ACKCODE $RECOVERED $DOWNSECSMSG" $RCPT
exit 0
#-----------------------------------------------------
custom_grep.pl:
#-----------------------------------------------------
#!/usr/bin/perl
# searching for lines which has "&red"
while (<>) {
@maches=/&red .*\s/ig;
foreach $_ (@maches) {
s/<.*?>//ig; # removing all the html tags
print "$_ ";
▸
}
}
#-----------------------------------------------------
On Thu, May 12, 2011 at 3:31 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:
Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C
list Sonal Kumar
Hi Gatis,
Thanks for providing the scipt ,after applying it ,we are getting blank
mails as below
sapsrp disk - red 718518
XYMON
X
Reply
from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid
date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518
So just one more favour,as i am not good at scripting.
We need the mail to be some thing line below. with the body displaying
alert and and TEXT having some presentable format with possible action
items.
sapsrp disk </filesystem name> - red 718518
XYMON
X
Reply
from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid
date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518
Hi team,
Please look at the below alert for system <hostname> and take the action.
▸
red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok
&red /var (98% used) has reached the PANIC level (90%)
Action: Remove the irrelevant files from </filesystem>
▸
On Fri, May 13, 2011 at 2:06 AM, Gatis A. <user-e47f4dceddb4@xymon.invalid> wrote:Hi, Quick and dirty solution to get &red lines to be sent out only (tested with xymon 4.2.2) Basicly $BBALPHAMSG variable is the key here! hobbit-alerts.cfg: #----------------------------------------------------- GROUP=TESTGROUP SCRIPT /path/to/custom_alerts.sh user-3a7b9bbe2bfd@xymon.invalid #----------------------------------------------------- custom_alerts.sh: #----------------------------------------------------- #!/bin/bash BBALPHAMSG=`echo "$BBALPHAMSG" | /path/to/custom_grep.pl`;export BBALPHAMSG if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi echo "${BBALPHAMSG:0:300}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" $RCPT exit 0 #----------------------------------------------------- custom_grep.pl: #----------------------------------------------------- #!/usr/bin/perl # searching for lines which has "&red" while (<>) { @maches=/&red .*\s/ig; foreach $_ (@maches) { s/<.*?>//ig; # removing all the html tags print "$_ "; } } #----------------------------------------------------- On Thu, May 12, 2011 at 3:31 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C
-- Thanks & Regards Sonal kumar N C
list Sonal Kumar
Hi team, Please suggest if there is any possibility to modify the body of the email alert as below as my client needs such format.
▸
On Fri, May 13, 2011 at 7:42 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:
Hi Gatis,Thanks for providing the scipt ,after applying it ,we are getting blank mails as below sapsrp disk - red 718518 XYMON X Reply from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518 So just one more favour,as i am not good at scripting. We need the mail to be some thing line below. with the body displaying alert and and TEXT having some presentable format with possible action items. sapsrp disk </filesystem name> - red 718518 XYMON X Reply from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518 Hi team, Please look at the below alert for system <hostname> and take the action. red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) Action: Remove the irrelevant files from </filesystem> On Fri, May 13, 2011 at 2:06 AM, Gatis A. <user-e47f4dceddb4@xymon.invalid> wrote:Hi, Quick and dirty solution to get &red lines to be sent out only (tested with xymon 4.2.2) Basicly $BBALPHAMSG variable is the key here! hobbit-alerts.cfg: #----------------------------------------------------- GROUP=TESTGROUP SCRIPT /path/to/custom_alerts.sh user-3a7b9bbe2bfd@xymon.invalid #----------------------------------------------------- custom_alerts.sh: #----------------------------------------------------- #!/bin/bash BBALPHAMSG=`echo "$BBALPHAMSG" | /path/to/custom_grep.pl`;export BBALPHAMSG if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi echo "${BBALPHAMSG:0:300}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" $RCPT exit 0 #----------------------------------------------------- custom_grep.pl: #----------------------------------------------------- #!/usr/bin/perl # searching for lines which has "&red" while (<>) { @maches=/&red .*\s/ig; foreach $_ (@maches) { s/<.*?>//ig; # removing all the html tags print "$_ "; } } #----------------------------------------------------- On Thu, May 12, 2011 at 3:31 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C
-- Thanks & Regards Sonal kumar N C
list Vernon Everett
Use the script option in the alerts file.
At a previous client, we had a very specific problem we were monitoring for.
Instead of Xymon sending a standard alert email, I needed a set of detailed
instructions sent out, indicating how to resolve the issue.
I then created a script to send the custom email, instead.
It worked so well, the client asked me to use the technique for a number of
other problem areas.
Most popular use was to send instructions to helpdesk, explaining who to log
the call to, and the severity level.
Regards
Vernon
▸
On Mon, May 16, 2011 at 6:10 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:
Hi team, Please suggest if there is any possibility to modify the body of the email alert as below as my client needs such format. On Fri, May 13, 2011 at 7:42 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:Hi Gatis,Thanks for providing the scipt ,after applying it ,we are getting blank mails as below sapsrp disk - red 718518 XYMON X Reply from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518 So just one more favour,as i am not good at scripting. We need the mail to be some thing line below. with the body displaying alert and and TEXT having some presentable format with possible action items. sapsrp disk </filesystem name> - red 718518 XYMON X Reply from user-1bc03939b7bc@xymon.invalid to user-40212399ff4e@xymon.invalid date Fri, May 13, 2011 at 6:47 PM subject sapsrp disk - red 718518 Hi team, Please look at the below alert for system <hostname> and take the action. red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) Action: Remove the irrelevant files from </filesystem> On Fri, May 13, 2011 at 2:06 AM, Gatis A. <user-e47f4dceddb4@xymon.invalid> wrote:Hi, Quick and dirty solution to get &red lines to be sent out only (tested with xymon 4.2.2) Basicly $BBALPHAMSG variable is the key here! hobbit-alerts.cfg: #----------------------------------------------------- GROUP=TESTGROUP SCRIPT /path/to/custom_alerts.sh user-3a7b9bbe2bfd@xymon.invalid #----------------------------------------------------- custom_alerts.sh: #----------------------------------------------------- #!/bin/bash BBALPHAMSG=`echo "$BBALPHAMSG" | /path/to/custom_grep.pl`;export BBALPHAMSG if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi echo "${BBALPHAMSG:0:300}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" $RCPT exit 0 #----------------------------------------------------- custom_grep.pl: #----------------------------------------------------- #!/usr/bin/perl # searching for lines which has "&red" while (<>) { @maches=/&red .*\s/ig; foreach $_ (@maches) { s/<.*?>//ig; # removing all the html tags print "$_ "; } } #----------------------------------------------------- On Thu, May 12, 2011 at 3:31 PM, sonal kumar <user-40212399ff4e@xymon.invalid>wrote:Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C-- Thanks & Regards Sonal kumar N C
list Ford Alan
I have written an email script which displays as html (of course you have to have a html enabled email client). It checks for individual services and displays a fixed message, could also add checks for specific hosts to. Here is a sample (not sure if html will display properly thru here) Xymon Alert (red) : files utnfrc01.stanwell.com Files on server testserver.stanwell.com have not been updated recently testserver.stanwell.com:files red [124238] red Files status at Tue May 17 04:05:58 EST 2011 [red]/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip> File is missing File is missing [yellow]/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT> File is missing [green]/stanwell/data/mms/batcher/Holding</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/batcher/Holding>
▸
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Vernon Everett
Sent: Monday, 16 May 2011 9:21 PM
To: sonal kumar
Cc: Xymon mailinglist
Subject: Re: [Xymon] customize the email body alerts for xymon
Use the script option in the alerts file.
At a previous client, we had a very specific problem we were monitoring for.
Instead of Xymon sending a standard alert email, I needed a set of detailed instructions sent out, indicating how to resolve the issue.
I then created a script to send the custom email, instead.
It worked so well, the client asked me to use the technique for a number of other problem areas.
Most popular use was to send instructions to helpdesk, explaining who to log the call to, and the severity level.
Regards
Vernon
This email (including all attachments) may contain personal information and is intended solely for the named addressee. It is confidential and may be subject to legal or other professional privilege and any confidentiality or privilege is not waived or lost because this email has been sent to you by mistake. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. Any personal Information in this email must be handled in accordance with the Privacy Act 1988 (Cth). If you have received it in error, please let Stanwell Corporation Limited know by reply email, delete it from your system and destroy any copies. Stanwell is not responsible for any changes made to a document other than those made by Stanwell. Stanwell accepts no liability for any damage caused by this email or its attachments due to viruses, interference, interception, corruption or unauthorised access. If you have any doubts about the authenticity of an email purportedly sent by us, please contact us immediately. If this is a commercial electronic message within the meaning of the Spam Act 2003 (Cth), you may indicate that you do not wish to receive any further commercial electronic messages from Stanwell by emailing mailto:user-0c0f74357833@xymon.invalid...
list Vernon Everett
I no longer do much work for that client, and haven't been on site for over
a year, and have no idea when I will be there again.
However, from memory, it was really simple.
In hobbit-alerts.cfg (looks like it's been renamed to alerts.cfg in the new
version) you do something like this
HOST=foo SERVICE=stuff COLOR=red
SCRIPT=/my/script/location/mail_helpdesk.ksh
Check here for an example (commented out)
http://www.xymon.com/xymon-cgi/viewconf.sh?alert
Then your script, /my/script/location/mail_helpdesk.ksh
will look something like this
#!/usr/bin/ksh
echo "
Hi Helpdesk
Please log a high call and assign it to the DBA team.
Their disks are on fire, and need to be doused with fine lager,
which they must deliver to the sysadmin team before COB.
Thanks
Sysadmin Team " | mailx user-8a88f233d714@xymon.invalid
Make it executable, and it should be a go.
You can also customise it a little.
For one, you can add command line variables, which you can define in the
alerts file, and also, there are a lot of variable automagically defined for
you by Xymon.
(Check the alerts man page for more)
Try something like this.
HOST=foo SERVICE=stuff COLOR=red
SCRIPT=/my/script/location/mail_generic.ksh user-8a88f233d714@xymon.invalid DBA
#!/usr/bin/ksh
RECIPIENT=$1
LOGGROUP=$2
CALL_LEVEL=medium
[ "$BBCOLORLEVEL" = "RED" ] && CALL_LEVEL=high
echo "
Hi $RECIPIENT
Please log a $CALL_LEVEL call to $LOGGROUP, with the subject
\"$BBHOSTNAME - $BBSVCNAME problem - Please Investigate.\"
Please include this link in the service call ticket for more information
$(echo $BBALPHAMSG | grep http)
Thanks
Monitoring.
" | mailx $RECIPIENT
▸
On Tue, May 17, 2011 at 6:47 AM, FORD Alan <user-eb925835b8b9@xymon.invalid> wrote:
I have written an email script which displays as html (of course you have to have a html enabled email client). It checks for individual services and displays a fixed message, could also add checks for specific hosts to. Here is a sample (not sure if html will display properly thru here) Xymon Alert (red) : files utnfrc01.stanwell.com Files on server *testserver.stanwell.com* have not been updated recently testserver.stanwell.com:files red [124238] red Files status at Tue May 17 04:05:58 EST 2011
[image: red] /stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip<http://xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip>; File is missing File is missing [image: yellow]/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT<http://xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT>; File is missing [image: green]/stanwell/data/mms/batcher/Holding<http://xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/batcher/Holding>;
▸
*From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] *On
Behalf Of *Vernon Everett
*Sent:* Monday, 16 May 2011 9:21 PM
*To:* sonal kumar
*Cc:* Xymon mailinglist
*Subject:* Re: [Xymon] customize the email body alerts for xymon
Use the script option in the alerts file.
At a previous client, we had a very specific problem we were monitoring
for.
Instead of Xymon sending a standard alert email, I needed a set of detailed
instructions sent out, indicating how to resolve the issue.
I then created a script to send the custom email, instead.
It worked so well, the client asked me to use the technique for a number of
other problem areas.
Most popular use was to send instructions to helpdesk, explaining who to
log the call to, and the severity level.
Regards
Vernon
On Mon, May 16, 2011 at 6:10 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:
Hi team,
Please suggest if there is any possibility to modify the body of the email
alert as below as my client needs such format.
On Fri, May 13, 2011 at 7:42 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote:
Hi Gatis,
Thanks for providing the scipt ,after applying it ,we are getting blank
mails as below
sapsrp disk - red 718518
XYMON
X
*Error! Filename not specified.*Reply
*Error! Filename not specified.*
*Error! Filename not specified.*
from
*Error! Filename not specified.**user-1bc03939b7bc@xymon.invalid*
to
*Error! Filename not specified.*user-40212399ff4e@xymon.invalid
date
*Error! Filename not specified.*Fri, May 13, 2011 at 6:47 PM
subject
*Error! Filename not specified.*sapsrp disk - red 718518
▸
So just one more favour,as i am not good at scripting.
We need the mail to be some thing line below. with the body displaying
alert and and TEXT having some presentable format with possible action
items.
sapsrp disk </filesystem name> - red 718518
XYMON
X
*Error! Filename not specified.*Reply
*Error! Filename not specified.*
*Error! Filename not specified.*
from
*Error! Filename not specified.**user-1bc03939b7bc@xymon.invalid*
to
*Error! Filename not specified.*user-40212399ff4e@xymon.invalid
date
*Error! Filename not specified.*Fri, May 13, 2011 at 6:47 PM
subject
*Error! Filename not specified.*sapsrp disk - red 718518
▸
Hi team, Please look at the below alert for system <hostname> and take the action. red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) Action: Remove the irrelevant files from </filesystem> On Fri, May 13, 2011 at 2:06 AM, Gatis A. <user-e47f4dceddb4@xymon.invalid> wrote: Hi, Quick and dirty solution to get &red lines to be sent out only (tested with xymon 4.2.2) Basicly $BBALPHAMSG variable is the key here! hobbit-alerts.cfg: #----------------------------------------------------- GROUP=TESTGROUP SCRIPT /path/to/custom_alerts.sh user-3a7b9bbe2bfd@xymon.invalid #----------------------------------------------------- custom_alerts.sh: #----------------------------------------------------- #!/bin/bash BBALPHAMSG=`echo "$BBALPHAMSG" | /path/to/custom_grep.pl`;export BBALPHAMSG if [ $RECOVERED -eq 1 ] then RECOVERED="recovered" else RECOVERED="" fi echo "${BBALPHAMSG:0:300}" | mail -s "$BBHOSTNAME $BBSVCNAME - $BBCOLORLEVEL $ACKCODE $RECOVERED $DOWNSECSMSG" $RCPT exit 0 #----------------------------------------------------- custom_grep.pl: #----------------------------------------------------- #!/usr/bin/perl # searching for lines which has "&red" while (<>) { @maches=/&red .*\s/ig; foreach $_ (@maches) { s/<.*?>//ig; # removing all the html tags print "$_ "; } } #----------------------------------------------------- On Thu, May 12, 2011 at 3:31 PM, sonal kumar <user-40212399ff4e@xymon.invalid> wrote: Hi team, I need to customize the email body and pattern for the alerts receiving from xymon. As in the below alert mail for disk , - we need the mail to display only the filesystem which is critical in individual mails and avoid displaying the the entire list of filesystems. - We need to customise the body of the mail and add some meaningful text unique for each alert,let me know if any sample script can be used for it. - in below mail /oracle/SRP/sapdata0 alert is shown in KB UNITS, can this be changed to show MB units free Please suggest.thanks in advance ---------- Forwarded message ---------- From: <user-1bc03939b7bc@xymon.invalid> Date: Thu, May 12, 2011 at 5:31 PM Subject: Xymon [313335] sapsrp:disk CRITICAL (RED) To: user-40212399ff4e@xymon.invalid red Thu May 12 15:59:21 WST 2011 - Filesystems NOT ok &red /var (98% used) has reached the PANIC level (90%) &yellow /tempsp (96% used) has reached the WARNING level (95%) &yellow /usr/sap (81% used) has reached the WARNING level (70%) &yellow /oracle/SRP/saparch (77% used) has reached the WARNING level (75%) &yellow /oracle/SRP/sapdata0 (3013196 units free) has reached the WARNING level (3013199 units) Filesystem 1024-blocks Used Free %Used Mounted on /dev/hd4 1048576 473192 575384 46% / /dev/hd2 10485760 4792084 5693676 46% /usr /dev/hd9var 524288 513520 10768 98% /var /dev/hd3 1572864 950588 622276 61% /tmp /dev/hd1 262144 968 261176 1% /home /proc - - - - /proc /dev/hd10opt 1179648 478100 701548 41% /opt /dev/lvsrporacle 212992 103972 109020 49% /oracle /dev/lvsrp_client 409600 264280 145320 65% /oracle/client /dev/lvsrp_srp 1359872 262204 1097668 20% /oracle/SRP /dev/fslv01 5242880 5006128 236752 96% /tempsp /dev/lvsrpmira 720896 410056 310840 57% /oracle/SRP/mirrlogA /dev/lvsrpmirb 720896 410056 310840 57% /oracle/SRP/mirrlogB /dev/lvsrporia 720896 426576 294320 60% /oracle/SRP/origlogA /dev/lvsrporib 720896 410056 310840 57% /oracle/SRP/origlogB /dev/lvsrp_sapreorg 565248 33572 531676 6% /oracle/SRP/sapreorg /dev/lvsrp_sapmnt 4194304 2273984 1920320 55% /sapmnt/SRP /dev/lvsrp_usr_sap 7856128 6303556 1552572 81% /usr/sap /dev/lvsrp_102 8183808 5288020 2895788 65% /oracle/SRP/102_64 /dev/lvsrparch 10240000 7882476 2357524 77% /oracle/SRP/saparch /dev/lvsrpdata0 185073664 182060468 3013196 99% /oracle/SRP/sapdata0 See http://sapsrp/xymon-cgi/svcstatus.sh?HOST=sapsrp&SERVICE=disk -- Thanks & Regards Sonal kumar N C -- Thanks & Regards Sonal kumar N C -- Thanks & Regards Sonal kumar N C -- Thanks & Regards Sonal kumar N C This email (including all attachments) may contain personal information and is intended solely for the named addressee. It is confidential and may be subject to legal or other professional privilege and any confidentiality or privilege is not waived or lost because this email has been sent to you by mistake. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. Any personal Information in this email must be handled in accordance with the Privacy Act 1988 (Cth). If you have received it in error, please let Stanwell Corporation Limited know by reply email, delete it from your system and destroy any copies. Stanwell is not responsible for any changes made to a document other than those made by Stanwell. Stanwell accepts no liability for any damage caused by this email or its attachments due to viruses, interference, interception, corruption or unauthorised access. If you have any doubts about the authenticity of an email purportedly sent by us, please contact us immediately. If this is a commercial electronic message within the meaning of the Spam Act 2003 (Cth), you may indicate that you do not wish to receive any further commercial electronic messages from Stanwell by emailing mailto:user-0c0f74357833@xymon.invalid...
list Daniel Nordquist
Sorry if I'm missing something obvious, but I'm looking to add custom text to the BBALPHAMSG in my script and I don't see how that's done with the example in this thread. Can someone enlighten me? Thanks, Dan Nordquist IS Systems Support Orlando Health orlandohealth.com<http://www.orlandohealth.com/>; facebook.com/orlandohealth<http://www.facebook.com/orlandohealth>; youtube.com/orlandohealth @orlandohealth on twitter XXXX Kuhl Ave., MP 56 Orlando, FL XXXXX tel: XXX.XXX.XXXX
▸
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of FORD Alan
Sent: Monday, May 16, 2011 6:58 PM
To: 'Xymon mailinglist'
Subject: Re: [Xymon] customize the email body alerts for xymon
I have written an email script which displays as html (of course you have to have a html enabled email client).
It checks for individual services and displays a fixed message, could also add checks for specific hosts to.
Here is a sample (not sure if html will display properly thru here)
Xymon Alert (red) : files utnfrc01.stanwell.com
Files on server testserver.stanwell.com have not been updated recently
testserver.stanwell.com:files red [124238]
red Files status at Tue May 17 04:05:58 EST 2011
[cid:user-cb74c2b11d5b@xymon.invalid6AFEB0]/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip>
File is missing
File is missing
[cid:user-e7e27465273e@xymon.invalid6AFEB0]/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT>
File is missing
[cid:user-82ed760838ad@xymon.invalid6AFEB0]/stanwell/data/mms/batcher/Holding</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/batcher/Holding>
▸
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Vernon Everett
Sent: Monday, 16 May 2011 9:21 PM
To: sonal kumar
Cc: Xymon mailinglist
Subject: Re: [Xymon] customize the email body alerts for xymon
Use the script option in the alerts file.
At a previous client, we had a very specific problem we were monitoring for.
Instead of Xymon sending a standard alert email, I needed a set of detailed instructions sent out, indicating how to resolve the issue.
I then created a script to send the custom email, instead.
It worked so well, the client asked me to use the technique for a number of other problem areas.
Most popular use was to send instructions to helpdesk, explaining who to log the call to, and the severity level.
Regards
Vernon
This email (including all attachments) may contain personal information and is intended solely for the named addressee. It is confidential and may be subject to legal or other professional privilege and any confidentiality or privilege is not waived or lost because this email has been sent to you by mistake. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. Any personal Information in this email must be handled in accordance with the Privacy Act 1988 (Cth). If you have received it in error, please let Stanwell Corporation Limited know by reply email, delete it from your system and destroy any copies. Stanwell is not responsible for any changes made to a document other than those made by Stanwell. Stanwell accepts no liability for any damage caused by this email or its attachments due to viruses, interference, interception, corruption or unauthorised access. If you have any doubts about the authenticity of an email purportedly sent by us, please contact us immediately. If this is a commercial electronic message within the meaning of the Spam Act 2003 (Cth), you may indicate that you do not wish to receive any further commercial electronic messages from Stanwell by emailing mailto:user-0c0f74357833@xymon.invalid...
This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited.
This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: user-40803320aaf5@xymon.invalid .
If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Health by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Health.
list Ford Alan
Here is my script called email_mess_html
#!/bin/sh
SMAIL="/usr/sbin/sendmail -t"
BBH_HOSTNAME=$BBHOSTSVC
if [ "$RECOVERED" = 1 ]
then
BBCOLORLEVEL=green
export BBCOLORLEVEL
CANNED_MESS="Service <b>$BBSVCNAME</b> has RECOVERED"
else
case $BBSVCNAME in
ora_ez2update)
CANNED_MESS="<b>EZ2UPDATE</b> has not updated database recently"
;;
files|filest)
CANNED_MESS="Files on server <b>${BBH_HOSTNAME}</b> have not been updated recently"
;;
esac
fi
if [ ${BBH_HOSTNAME} = "xytest.stanwell.com" ]
then
CANNED_MESS=`env | sort`
fi
GREEN_GIF=cid:user-afc6f17cd65d@xymon.invalid
YELLOW_GIF=cid:user-4b3c3810c067@xymon.invalid
RED_GIF=cid:user-6e96f0dffc71@xymon.invalid
GREEN_IMG="<img src=${GREEN_GIF} alt=green height=16 width=16 border=0>"
YELLOW_IMG="<img src=${YELLOW_GIF} alt=yellow height=16 width=16 border=0>"
RED_IMG="<img src=${RED_GIF} alt=red height=16 width=16 border=0>"
export BBALPHAMSG GREEN_IMG RED_IMG YELLOW_IMG
SUBJECT="Xymon Alert (${BBCOLORLEVEL}) : ${BBSVCNAME} ${BBH_HOSTNAME}"
EMBOUND="blahblah_xymon.stanwell.com"
$SMAIL <<DATA
To: ${RCPT}
From: user-a8c08fe2265b@xymon.invalid
Subject: ${SUBJECT}
Content-Type: multipart/related;
boundary=${EMBOUND};
type="Text/HTML"
MIME-Version: 1.0
--${EMBOUND}
Content-Type: text/html; charset=US-ASCII
<html>
<body>
<basefont face=Arial size=2 >
<h2><span style=background-color:${BBCOLORLEVEL}>Xymon Alert (${BBCOLORLEVEL}) : ${BBSVCNAME} ${BBH_HOSTNAME}</span></h2>
<br>
${CANNED_MESS}
<br><br>
`printenv BBALPHAMSG | sed "s/\"//g" | perl -pe "s/\n|\r/<br>/g" | sed "s?&green?${GREEN_IMG}?g" | sed "s?&yellow?${YELLOW_IMG}?g" | sed "s?&red?${RED_IMG}?g" | sed "s?gifs/green.gif?${GREEN_GIF}?g" | sed "s?/gifs/yellow.gif?${YELLOW_GIF}?g" | sed "s?gifs/red.gif?${RED_GIF}?g"`
<br>
<h4>Message was alerted from line $CFID in alerts.cfg<h4>
</body>
</html>
--${EMBOUND}
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Id: <user-afc6f17cd65d@xymon.invalid>
R0lGODlhEAAQAKIBAP///8DAwEn4BkmrNT6AJj5ZJzj/AQAAACH5BAEAAAEALAAAAAAQABAAQAM7
GLrceiTKQutpR+jBr3sR5X2PMIyYpnIsGkCTRT7ufNROZp6kvrWMjGE4ZAFBEkJFlIsVcAvIc0Zd
JAAAOw==
--${EMBOUND}
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Id: <user-4b3c3810c067@xymon.invalid>
R0lGODlhIAAgAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/
/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm
AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/
MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm
ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/
mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm
zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/
/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ
AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA
M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ
ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A
mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z
zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAgACAA
AAj/AFEIHEhQ4BQUBw9KQViwoUOCfvyk8nOKT0VTfPg83Mhwih9q1PpJ2xdtHzRldhYu5Dgwoh+E
flD1qacPGiiMC+3oZIkwFbVUCafcMVXPVEKEmohpWvnQT59UqCa6xNPHIpWEeERpArXToZQ+01B5
/EctX1k/Hqmh/Tjqjh1lmpg8PCXtFIqP//Lme1noJ4pRzlKh4KMM1MMpp/bxGZv3394pf/5NHJXv
zxQ+9EAxJdgnGjSNf6g1VosCFchR1Jz9YQJKGcqCHvvtU8zY8WM/jfM9tkOPnruUBFHxMwkapB9n
zl7izat6sDJ6hQl+Ha5vceSJouThqa17O+/ewAee/6pHHIVPwaKOiUIR2rYzPM59Gx4ohc8+fdXT
or3TbLuffNXk44w8d0jx3W+bmQJNTcrw0cdVKDRxRygO4vEHHnjcUZVr0M0nUH346UNPPaAohBAo
RRU4BROX9eZieAKBQo+IIn4GCh83QtNbRjw+p4878kmH2Yz46WgkjUbSs+CMvbmDYEFvzXgSKNAs
iJ+SVFopInSvNSSFjPiZYgdmIVY3Zm809qbZQ6C4IyJGY1b5GR9j9thbdA995yKdfHw2ZmFSMPGl
b79tpJMySzbI41vuoESnayjZwVF9Lu6YUaXQQefOUjwZeONzcD3nG6GgcCUpTyioxEejrDrpJHCb
oRmaqh2lcmUrjLIWpFKqvMaa66/ABisssAEBADs=
--${EMBOUND}
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Id: <user-6e96f0dffc71@xymon.invalid>
R0lGODlhIAAgAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/
/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm
AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/
MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm
ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/
mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm
zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/
/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ
AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA
M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ
ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A
mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z
zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAgACAA
AAj/AFEIHEhQ4BQUBxOikFKwoUOCU+6IurOJIkU4TB5qRJFxyiZ1xtSJ/KVuHC6MHDdClLjJ2LiS
42LGxHUSY0aVEeOFjMltXE9uQLnRpEQJpcY7d0I22/QLKC6hUGnCIUqJyU2Hd+LFU3dnCpynQcGe
ZPIVV1WNH9f9ssOxbNSxKL5yK/rQI0w4AqXIdQqHYVy+fgsm/WUSrwsXemn66ns47lOzVw3egQmU
MQ0XWCiZxULjst6wVSOLKun0JMPDdoo2TvzYLN6BOWcCXkhpLsPEpTUbFdjSGJzfNM0WDT5Vs9Df
TIi+Nvhx00GywaNLh0u2aORNuH6hrP67u3frApPTtR1I1qfplFOsIrTK5PnCsnAH7oX7IiKcO1nu
3NdSo23w8eG5JVR7WjRD2C8GjoOgFl7RNFdoBSX3GF5+hNQTYRfe4ZhQZzWEGzd9TcaTTyRiJNd5
Dp1Y1H2iYKjgJt1p5ppG8Ek1RYEHNuNHg0N16FB1j1V1o374pWecdZE1BF10cCTUHnyUaKKeSmT9
pllVJoq34pQqpVQdVWBC2OWPVZqIXJJjEsRQRmsulOabcMYp55wPBQQAOw==
--${EMBOUND}--
DATA
▸
From: Nordquist, Daniel [mailto:user-b7c65cb59f49@xymon.invalid] Sent: Thursday, 3 November 2011 1:03 AM To: FORD Alan; 'Xymon mailinglist' Subject: RE: [Xymon] customize the email body alerts for xymon Sorry if I'm missing something obvious, but I'm looking to add custom text to the BBALPHAMSG in my script and I don't see how that's done with the example in this thread. Can someone enlighten me? Thanks, Dan Nordquist IS Systems Support Orlando Health orlandohealth.com<http://www.orlandohealth.com/>; facebook.com/orlandohealth<http://www.facebook.com/orlandohealth>; youtube.com/orlandohealth @orlandohealth on twitter XXXX Kuhl Ave., MP 56 Orlando, FL XXXXX tel: XXX.XXX.XXXX From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of FORD Alan Sent: Monday, May 16, 2011 6:58 PM To: 'Xymon mailinglist' Subject: Re: [Xymon] customize the email body alerts for xymon I have written an email script which displays as html (of course you have to have a html enabled email client). It checks for individual services and displays a fixed message, could also add checks for specific hosts to. Here is a sample (not sure if html will display properly thru here) Xymon Alert (red) : files utnfrc01.stanwell.com Files on server testserver.stanwell.com have not been updated recently testserver.stanwell.com:files red [124238] red Files status at Tue May 17 04:05:58 EST 2011 [red]/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip> File is missing File is missing [yellow]/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT> File is missing [green]/stanwell/data/mms/batcher/Holding</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/batcher/Holding> From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Vernon Everett Sent: Monday, 16 May 2011 9:21 PM To: sonal kumar Cc: Xymon mailinglist Subject: Re: [Xymon] customize the email body alerts for xymon Use the script option in the alerts file. At a previous client, we had a very specific problem we were monitoring for. Instead of Xymon sending a standard alert email, I needed a set of detailed instructions sent out, indicating how to resolve the issue. I then created a script to send the custom email, instead. It worked so well, the client asked me to use the technique for a number of other problem areas. Most popular use was to send instructions to helpdesk, explaining who to log the call to, and the severity level. Regards Vernon This email (including all attachments) may contain personal information and is intended solely for the named addressee. It is confidential and may be subject to legal or other professional privilege and any confidentiality or privilege is not waived or lost because this email has been sent to you by mistake. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. Any personal Information in this email must be handled in accordance with the Privacy Act 1988 (Cth). If you have received it in error, please let Stanwell Corporation Limited know by reply email, delete it from your system and destroy any copies. Stanwell is not responsible for any changes made to a document other than those made by Stanwell. Stanwell accepts no liability for any damage caused by this email or its attachments due to viruses, interference, interception, corruption or unauthorised access. If you have any doubts about the authenticity of an email purportedly sent by us, please contact us immediately. If this is a commercial electronic message within the meaning of the Spam Act 2003 (Cth), you may indicate that you do not wish to receive any further commercial electronic messages from Stanwell by emailing mailto:user-0c0f74357833@xymon.invalid... This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: user-40803320aaf5@xymon.invalid . If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Health by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Health.
This email is to be read subject to the email disclaimer located at http://www.stanwell.com/email-disclaimer.aspx
list Daniel Nordquist
Thanks for the script, Alan. Much appreciated, however, what I'm looking to do is simply add some text to the existing bbalphamsg without converting it to html and/or creating a completely new message. Is it possible to import the $bbalphamsg, add to it, and then export it back out? I'm not proficient enough with linux scripting to know this, so please forgive me if I'm asking noob questions.
▸
Thanks, Dan Nordquist IS Systems Support Orlando Health orlandohealth.com<http://www.orlandohealth.com/>; facebook.com/orlandohealth<http://www.facebook.com/orlandohealth>; youtube.com/orlandohealth @orlandohealth on twitter XXXX Kuhl Ave., MP 56 Orlando, FL XXXXX tel: XXX.XXX.XXXX From: Nordquist, Daniel [mailto:user-b7c65cb59f49@xymon.invalid] Sent: Thursday, 3 November 2011 1:03 AM To: FORD Alan; 'Xymon mailinglist' Subject: RE: [Xymon] customize the email body alerts for xymon Sorry if I'm missing something obvious, but I'm looking to add custom text to the BBALPHAMSG in my script and I don't see how that's done with the example in this thread. Can someone enlighten me? Thanks, Dan Nordquist IS Systems Support Orlando Health orlandohealth.com<http://www.orlandohealth.com/>; facebook.com/orlandohealth<http://www.facebook.com/orlandohealth>; youtube.com/orlandohealth @orlandohealth on twitter XXXX Kuhl Ave., MP 56 Orlando, FL XXXXX tel: XXX.XXX.XXXX From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of FORD Alan Sent: Monday, May 16, 2011 6:58 PM To: 'Xymon mailinglist' Subject: Re: [Xymon] customize the email body alerts for xymon I have written an email script which displays as html (of course you have to have a html enabled email client). It checks for individual services and displays a fixed message, could also add checks for specific hosts to. Here is a sample (not sure if html will display properly thru here) Xymon Alert (red) : files utnfrc01.stanwell.com Files on server testserver.stanwell.com have not been updated recently testserver.stanwell.com:files red [124238] red Files status at Tue May 17 04:05:58 EST 2011
[cid:image001.png at 01CC9A09.8CF2B040]/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/loader/Reports/STANWELL_P5MIN_201105170410_20110517040540.zip>
File is missing
File is missing
[cid:image002.png at 01CC9A09.8CF2B040]/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/scada/sps/incoming/unit2/MTBIN.DAT>
File is missing
[cid:image003.gif at 01CC9A09.8CF2B040]/stanwell/data/mms/batcher/Holding</xymon-cgi/bb-hostsvc.sh?CLIENT=utnfrc01.stanwell.com&SECTION=file:/stanwell/data/mms/batcher/Holding>
▸
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Vernon Everett
Sent: Monday, 16 May 2011 9:21 PM
To: sonal kumar
Cc: Xymon mailinglist
Subject: Re: [Xymon] customize the email body alerts for xymon
Use the script option in the alerts file.
At a previous client, we had a very specific problem we were monitoring for.
Instead of Xymon sending a standard alert email, I needed a set of detailed instructions sent out, indicating how to resolve the issue.
I then created a script to send the custom email, instead.
It worked so well, the client asked me to use the technique for a number of other problem areas.
Most popular use was to send instructions to helpdesk, explaining who to log the call to, and the severity level.
Regards
Vernon
This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited.
This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: user-40803320aaf5@xymon.invalid .
If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Health by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Health.
list Ford Alan
Yeah no probs. I think this is what you want BBALPHAMSG=$BBALPHAMSG" Enter new Information here" Alan
▸
This email is to be read subject to the email disclaimer located at http://www.stanwell.com/email-disclaimer.aspx
list Daniel Nordquist
Well that's just too easy... heh. Thanks for your help! Dan Nordquist IS Systems Support Orlando Health orlandohealth.com facebook.com/orlandohealth
▸
youtube.com/orlandohealth
@orlandohealth on twitter
XXXX Kuhl Ave., MP 56
Orlando, FL XXXXX
tel: XXX.XXX.XXXX
-----Original Message-----
▸
From: FORD Alan [mailto:user-eb925835b8b9@xymon.invalid] Sent: Thursday, November 03, 2011 9:22 AM To: Nordquist, Daniel Cc: Xymon mailinglist Subject: Re: [Xymon] customize the email body alerts for xymon Yeah no probs. I think this is what you want BBALPHAMSG=$BBALPHAMSG" Enter new Information here" Alan This email is to be read subject to the email disclaimer located at http://www.stanwell.com/email-disclaimer.aspx This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message. To reply to our email administrator directly, send an email to: user-40803320aaf5@xymon.invalid . If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Health by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Health.