Visara Master Console Center Scripting Guide User Manual
Page 219
Chapter 6 Obsolete Material
Scripting Guide
219
Returns:
Numeric value for %Status, as follows:
Value
Meaning
0 or event read
Success
-1
Error
2
Timeout
Associative string array for $EventArray, which is first cleared.
If %Status is error, the ERRORNUM function returns one of the
following values:
Error
11002
11008
Manifest Constant
ERR_OED_QUEUE_NOT_OPEN
ERR_OED_QUEUE_ID_MUST_BE_SPECIFIED
Description
The queue is
not open
At least one
queue ID must
be specified.
Notes:
1. If the actual time and date when the event was generated is not
available, the time that the event enters the outside event daemon is
used.
2. The ‘nativeId’ field is normally the most unique name for the event,
as it comes directly from the generating system.
3. When comparing field names, consider translating the names to all
upper case or all lower case.
4. Scripts that use any fields other than those listed may not be
completely portable between event sources.
5. The order in which event queues are specified does not guarantee the
order in which the queues are searched for events.
6. If an error occurs (%Status=error), the queue is closed, and
subsequent EVENTREAD() and EVENTCLOSE() commands on the
affecting queue ID give an error.
Example:
// Open a queue for all BMC Patrol events.
%queueId[ 1 ] := EVENTOPEN( PATROL_EVENTS )
// Open a queue for BMC Patrol events on 'myOS' and
// 'yourOS'.
$osNames[ 1 ] := "myOS"
$osNames[ 2 ] := "yourOS"
%queueId[ 2 ] := EVENTOPEN( PATROL_EVENTS, $osNames )
// Read events.
WHILE( 1 )
%status := EVENTREAD( %queueId, $event, 10 )
IF( %status == EVENT_READ )
LOG( LOG_EXEC, "Event:" )
LOG( LOG_EXEC, " id=" + $event[ "nativeId" ])
// Send corrective action.
%port := PORT( OS, $event[ "osName" ] )
KEY( %port, "Corrective action." )
ELSE
GOTO
*done
ENDIF
ENDWHILE