You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

\n \n \n \n \n \n \n \n \n \n \n \n
Related \nDocumentationVersion \nof up.time \naffectedAffected \nPlatforms
\n AllAll
\n

\n \n

Article \nContents \n

\n \n
\n \n

Overview

\n \n

When a service outage occurs, up.time can generate an alert in a number of ways including sending an email, opening a Windows pop-up or initiating a pager message. You can also define your own Script Alert that \nwill be executed on the monitoring station when an outage occurs. You can use the Script Alert option to create custom alerting methods that fit your exact needs. Some examples of custom alerting implementations include:

\n \n
    \n
  • SMS modem-based \nalerting
  • \n
  • TAPI modem alerting
  • \n
  • Internal Problem \nTicket creation system alerts
  • \n
  • On call team \nrotation
  • \n
  • Customized alert \nemail body formatting \n
  • \n
\n

\n \n


\n \n

How custom alert scripts work

\n \n

Custom alert scripts are defined with the Script Alert option on the Alert Profile page. The script is a path to a script or executable on the monitoring station system that up.time will run when a service outage occurs. You control the actions that the script or executable takes, which provides full control over how up.time sends out alert notifications during a service outage.

\n \n

Note: For \nWindows alert scripts, the path used must use UNIX-style / instead of \ and must be quoted if your path contains spaces. For example:
\n "C:/Program \nFiles/uptime software/uptime/scripts/my_custom_alerter.bat"

\n \n

When up.time runs the script or executable, it passes on information about the specific service outage that triggered the alert. This information is passed using the system environment variables that are local to each execution of the recovery script. The script or \nexecutable is run once for each up.time user that will be notified using this alert.

\n \n

The environment variables passed to the alert script and their meanings are included below: \n \n

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
VariableDescriptionExample \nContents
Service \nMessage Fields - These will remain constant for each \nexecution of your script associated with a single service outage.
UPTIME_ALERTTYPEThis is the \ntype of alert messageOne of: \nProblem, Recovery
UPTIME_HOSTNAMEThe name of the \nhost that the service outage is associated with.oracle_server
UPTIME_HOSTSTATUSThe status of \nthe host that the service outage is associated with.One of: OK, \nWARN, CRIT, MAINT, UNKNOWN
UPTIME_MESSAGEThe output \nsection of the alert.Type: Problem
\nService: db_status (CRIT/threshold error)
\nHost: oracle_db (OK)
UPTIME_SUBJECTThe subject \nline that would normally appear in an emailed alert for this alert.Uptime Alert - \nUPTIME-oracle_server -> CRIT
UPTIME_SVCNAMEThe name of the \nservice monitor generating this alert.UPTIME-oracle_server
UPTIME_SVCOUTPUTThe output of \nthe service monitor generating this alert.processoccurrences: \n0 is less than 1
UPTIME_SVCSTATUSThe current \nstatus of the service monitor generating this alert.One of: OK, \nWARN, CRIT, MAINT, UNKNOWN.
UPTIME_DATETIMEThe date and \ntime of the alert.Mon May 15 \n11:12:22 EDT 2006
User \nrelated fields - these will change for each user that is \npassed to your script, the script will be executed once for each user \nthat should be notified.
UPTIME_CONTACTLOGINNAMEThe login name \nof the user who is being notified.testuser
UPTIME_DESKTOPHOSTThe windows \ndesktop hostname setting for the user being notified.testuser-pc
UPTIME_DESKTOPWORKGROUPThe windows \nworkgroup for the desktop host specified above.WORKGROUP
UPTIME_EMAILThe email \naddress associated with the user who is being notified.[email protected]
UPTIME_MOBILEThe pager \nnumber associated with the user being notified.[email protected]
General \nfields
UPTIME_SCRIPTThe name of the \ncurrent script being executed.C:/Program \nFiles/uptime software/uptime4/scripts/my_custom_alerter.bat
UPTIME_SMTPHELOSTRINGThe HELO string \nused in your SMTP server configuration. \n
UPTIME_SMTPPASSWORDThe password \nused from authentication in your SMTP server configuration. \n
UPTIME_SMTPPORTThe server port \nused in your SMTP server configuration. \n
UPTIME_SMTPSENDERThe sender \naddress string used in your SMTP server configuration. \n
UPTIME_SMTPSERVERThe server \nhostname used in your SMTP server configuration. \n
UPTIME_SMTPUSERThe user name \nused for authentication in your SMTP server configuration. \n
\n

\n \n
\n \n

Environment Variable Examples
\n

\n

How the script or executable uses environment \nvariables will vary depending on the language you have used to write your script or executable. The following examples illustrate how environment variables are accessed in several common languages:

\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
LanguageCommon \nmethods of accessing environment variables.
Perl \n

Use of the ENV \narray to access environment variables with Perl. For example:

\n

#!/usr/bin/perl
\nmy $user_email = $ENV{UPTIME_EMAIL};
\nmy $user_mobile = $ENV{UPTIME_MOBILE};

\n
PHPWhen run from \nthe command line, use the getenv() \nfunction to access environment variables within PHP. For example: \n

«?php
\n$user_email = getenv('UPTIME_EMAIL');
\n$user_mobile = getenv('UPTIME_MOBILE');

\n
Bash and KshBash and Ksh \nenable you to access local environment variables just like any other \nlocal variable. For example: \n

#!/bin/bash
\nEMAIL=$UPTIME_EMAIL
\nMOBILE=$UPTIME_MOBILE

\n
Batch FileAdd the % symbol around \nthe names of environment variables in Windows batch files. For example: \n

echo %UPTIME_EMAIL%
\necho %UPTIME_MOBILE%

\n
VB ScriptUse the the \n oShell.Environment \nlookup function to access environment variables with \nVB Script. For example: \n

Dim email, mobile
\nDim WshShell, objEnv
\n
\nSet WshShell = CreateObject("WScript.Shell")
\n
\nSet objEnv = WshShell.Environment("Process")
\n
\nemail = objEnv("UPTIME_EMAIL")
\nmobile = objEnv("UPTIME_MOBILE")

\n
\n
  • No labels