Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
Image Removed Overview
Image Removed How custom alert scripts work
Image Removed Environment Variable Examples

...

maxLevel2
minLevel2

...

When a service outage occurs, Uptime Infrastructure Monitor 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 will be script alert that is 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:Image Removed

  • SMS modem-based alerting

...

  • TAPI modem alerting

...

  • Internal Problem Ticket creation system alerts

...

  • On call team rotation

...

  • Customized alert email body formatting

...

How custom alert scripts work

Please review the online documentation available here - Alerts and Actions
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 Uptime Infrastructure Monitor will run UIM runs when a service outage occurs. You control the actions that the script or executable takes, which provides full control over how Uptime Infrastructure Monitor sends out alert notifications during a service outage.Image Removed Note

Info

For Windows alert scripts, the path used must use UNIX-style / instead of \ and must be quoted if your path contains spaces. For example:

...

C:/Program Files/uptime software/uptime/scripts/my_custom_alerter.bat

...

When Uptime Infrastructure Monitor UIM 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 executable is run once for each Uptime Infrastructure Monitor UIM user that will be is notified using this alert.

The environment variables passed to the alert script and their meanings are included below in the following table but for the latest documentation please refer to the Alert Profileprofile and Action Profile Variables: profile variables topics in the main UIM Help documentation.

- will related fields - these will that is , the script will be should be fields
VariableDescriptionExample Contents

Service Message Fields

These

fields remain constant for each execution of your script associated with a single service outage.

UPTIME_ALERTTYPEThis is the type Type of alert message.One of: Problem, Recovery
UPTIME_HOSTNAMEThe name Name of the host that associated with the service outage is associated with.oracle_server
UPTIME_HOSTSTATUSThe status Status of the host that associated with the service outage is associated with.One of: OK, WARN, CRIT, MAINT, UNKNOWN
UPTIME_MESSAGEThe output section Output selection of the alert.

Type: Problem

Service: db_status (CRIT/threshold error)

Host: oracleorale_db (OK)

UPTIME_SUBJECTThe subject Subject line that would normally appear in an emailed alert appears in the email message for this alert.Uptime Alert - : UPTIME-oracle_server -> CRIT
UPTIME_SVCNAMEThe name Name of the service monitor generating this alert.UPTIME-oracle_server
UPTIME_SVCOUTPUTThe output Output of the service monitor generating this alert.processoccurrences: 0 is less than 1
UPTIME_SVCSTATUSThe current Current status of the service monitor generating this alert.One of: OK, WARN, CRIT, MAINT, UNKNOWN.
UPTIME_DATETIMEThe date Date and time of the alert.Mon May 15 11:12:22 EDT 2006CDT 2024

User

-Related Fields

These fields

change for each user

passed to your script

. The script is executed once for each user that

you want notified.

UPTIME_CONTACTLOGIN NAMECONTACTLOGINNAMEThe login Login name of the notified user who is being notifiedaccount.testuser
UPTIME_DESKTOPHOSTThe windows Windows desktop hostname homename setting for of the notified user being notifiedaccount.testuser-pc
UPTIME_DESKTOPWORK GROUPDESKTOPWORKGROUPThe windows Windows workgroup for the desktop host specified above.WORKGROUP
UPTIME_EMAILThe email Email address associated with of the notified user who is being notifiedaccount.testuser@yourcompany.com
UPTIME_MOBILEThe pager Pager number associated with of the notified user being notifiedaccount.1234123@sms.mynetwork.com
General Fields
UPTIME_SCRIPTThe name Name of the current script being executed.C:/Program Files/uptime software/uptime4uptime710/scripts
/my_custom_alerter.bat
UPTIME_SMTPHELOSTRI NGSMTPHELOSTRINGThe HELO string used in your SMTP server configuration.
UPTIME_SMTPPASSWORDThe password Password used from authentication in your SMTP server configuration.
UPTIME_SMTPPORTThe server Server port used in your SMTP server configuration.
UPTIME_SMTPSENDERThe sender Sender address string used in your SMTP server configuration.
UPTIME_SMTPSERVERThe server Server hostname used in your SMTP server configuration.
UPTIME_SMTPUSERThe user User name used for authentication in your SMTP server configuration.

...


...

Environment variable examples

How the script or executable uses environment variables 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: .

.
LanguageCommon methods of accessing environment variables
Perl

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

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

PHP

When run from the command line, use the getenv() function to access environment variables within PHP. For example:

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

Bash and Ksh

Bash and Ksh enable you to access local environment variables just like any other local variable. For example:

#!/bin/bash
EMAIL=$UPTIME_EMAIL
MOBILE=$UPTIME_MOBILE

Batch File

Add the % symbol around the names of environment variables in Windows batch files. For example:

echo %UPTIME_EMAIL%
echo %UPTIME_MOBILE%

VB Script

Use the the oShell.Environment lookup function to access environment variables with VB Script. For example:

Dim email, mobile
Dim WshShell, objEnv

Set WshShell = CreateObject("WScript.Shell")

Set objEnv = WshShell.Environment("Process")

email = objEnv("UPTIME_EMAIL")
mobile = objEnv("UPTIME_MOBILE")