Alerts variables

Nordquist, Daniel Daniel.Nordquist at orlandohealth.com
Fri Feb 11 19:28:28 CET 2011


Did NOT work in a real alert script...

Anyone know if Xymon sends the color blue or not?  Is there another variable that indicates "disabled"?


From: Nordquist, Daniel
Sent: Friday, February 11, 2011 12:54 PM
To: xymon at xymon.com
Subject: [xymon] RE: Alerts variables

This works in a test script...  If Xymon actually sends the $bbcolorlevel of blue it should work in an alert script.  I'll try that on a test host and see if it works properly.


#!/bin/bash

RCPT=daniel.nordquist at orhs.org
BBHOSTNAME=test123
BBSVCNAME=testsvc
BBCOLORLEVEL=blue
BBALPHAMSG="This is the test message..."
RECOVERED=1

if [ "$RECOVERED" -eq 1 ] && [ "$BBCOLORLEVEL" != blue ]; then
  STATUS="RECOVERED"
else
  case $BBCOLORLEVEL in
    red)
      STATUS="CRITICAL"
      ;;
    yellow)
      STATUS="WARNING"
      ;;
    purple)
      STATUS="stopped reporting"
      ;;
    blue)
      STATUS="Alert Disabled"
      ;;
    *)
      STATUS="unknown status"
      ;;
  esac
fi

MESSAGE="To: $RCPT
Subject: $BBHOSTNAME $BBSVCNAME $STATUS
Content-Type: text/plain
X-Priority: 1 (Highest)
X-MSMail-Priority: High
$BBALPHAMSG"

echo "$MESSAGE" | sendmail -t
exit 0




From: Nordquist, Daniel
Sent: Friday, February 11, 2011 12:34 PM
To: xymon at xymon.com
Subject: [xymon] RE: Alerts variables

I haven't tried this but I assume you could add the $bbcolorlevel "blue" to this script and add a status message of your choice to indicate it's been disabled?

I think your idea is a good one and I'm going to attempt to implement it on my system.

#!/bin/bash

if [ "$RECOVERED" -eq 1 ]; then
  STATUS="RECOVERED"
else
  case $BBCOLORLEVEL in
    red)
      STATUS="CRITICAL"
      ;;
    yellow)
      STATUS="WARNING"
      ;;
    purple)
      STATUS="stopped reporting"
      ;;
    *)
      STATUS="unknown status"
      ;;
  esac
fi

MESSAGE="To: $RCPT
Subject: $BBHOSTNAME $STATUS
Content-Type: text/plain
X-Priority: 1 (Highest)
X-MSMail-Priority: High

$BBALPHAMSG"

echo "$MESSAGE" | sendmail -t
exit 0



From: Johan Sjöberg [mailto:johan.sjoberg at deltamanagement.se]
Sent: Thursday, February 10, 2011 5:26 AM
To: xymon at xymon.com
Subject: [xymon] Alerts variables

Hi.

I am trying to improve the html e-mail alert script a bit. I want the background to be blue if the cause of a recovery is a disable. Is there some variable sent to the alert script that indicates that a disable is the cause of a recovery, or do I have to create logic for this in the script, guessing based on the colors in the status message?

/Johan


________________________________
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: postmaster at orlandohealth.com .

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 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: postmaster at orlandohealth.com .

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 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: postmaster at orlandohealth.com .

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20110211/00559360/attachment.html>


More information about the Xymon mailing list