beautypg.com

Visara Master Console Center Scripting Guide User Manual

Page 74

background image

Chapter 5 Script Commands

Scripting Guide

74

$AlertInfo[14] 'Quilt'

source

computer/OS

$AlertInfo[15] message

$AlertInfo[16] 'This\sis\sthe\smessage.' message

text

Note: Spaces are

represented by
'\s'.

$AlertInfo[17] userNote

$AlertInfo[18]

'This\sis\sthe\user\snote.'

user note, if any

$AlertInfo[19] whoLastModified

Examples:

Simple Script to log all of the alerts to the filtered message log.

%rc := ALERTGETACTIVE($AssocArray)

IF %rc == 0
%Num := ALEN($AssocArray) // Get the number of alerts
ASSOCKEYS( $AssocArray, $NormalArray) // Put into a normal
array
%Index := 1
WHILE %Index <= %Num // Log individual alert info
$Seq := $NormalArray[%Index]
$AlertInfo := $AssocArray[$Seq]
LOG(LOG_FLT, "Alert info is " + $AlertInfo)
INC %Index
ENDWHILE
ENDIF

Simple Script to break down all of the component parts of the returned

alert array and log everything to the filtered message log.

%rc := ALERTGETACTIVE( $Array )
LOG( LOG_FLT, "There are currently " + ALEN($Array) + \ "
active alerts." , 5)
%ArrayIndex := 1
WHILE (%ArrayIndex <= ALEN($Array))
SPLIT($AlertInfo, $Array[STR(%ArrayIndex)], " ")
GOSUB *PROCESS_ALERT_INFO
%ArrayIndex := %ArrayIndex + 1
ENDWHILE
RETURN
*PROCESS_ALERT_INFO:
LOG(LOG_FLT, "Alert #: " + STR(%ArrayIndex), 1)
LOG(LOG_FLT, $AlertInfo[1] + " : " + $AlertInfo[2], 5)
LOG(LOG_FLT, $AlertInfo[3] + " : " + $AlertInfo[4], 5)
LOG(LOG_FLT, $AlertInfo[5] + " : " + $AlertInfo[6], 5)
LOG(LOG_FLT, $AlertInfo[7] + " : " + $AlertInfo[8], 5)
LOG(LOG_FLT, $AlertInfo[9] + " : " + $AlertInfo[10], 5)
LOG(LOG_FLT, $AlertInfo[11] + " : " + $AlertInfo[12], 5)
LOG(LOG_FLT, $AlertInfo[13] + " : " + $AlertInfo[14], 5)
LOG(LOG_FLT, $AlertInfo[15] + " : " + $AlertInfo[16], 5)
LOG(LOG_FLT, $AlertInfo[17] + " : " + $AlertInfo[18], 5)
LOG(LOG_FLT, $AlertInfo[19] + " : " + $AlertInfo[20], 5)
LOG(LOG_FLT, "------------------------------------------",
1)
RETURN