remote_event_query()
Return a list of events in the PATROL Event Manager (PEM) repository of a remote PATROL Agent that match specified filter criteria.
Syntax
format,start-time,stop-time,status,type,node,
origin,pattern,IDrange,class,[severity])
Parameter
Parameter | Definition |
---|---|
sessionID | identifier of the remote PATROL Agent session to which the remote event query is directed The sessionID is returned by the remote_open() function when you open a remote PATROL Agent session. |
maxcount | string that is the maximum number of events that will be returned in the event query Specifying the NULL string (" ") causes maxcount to default to 100. |
timeout | string that is the maximum time in minutes that the session is willing to wait for the results of the remote event query |
delimiter | string that is used to separate each event in the list of events returned by the remote event query *Valid Values*
|
format | format string used to present each event entry See Specifying the event_query() Output FormatSpecifying the event_query() Output Format . Default
|
Parameter | Definition |
Filter: | |
start-time | time endpoint that specifies the oldest event timestamp that is valid for the remote event query*Valid Values*
The start-time variables have the following values: |
stop-time | time endpoint that specifies the most recent event timestamp that is valid for the remote event query*Valid Values*
The start-time variables have the following values: |
status | event status that is valid for the remote event query*Valid Values*
|
type | event type that is valid for the remote event query*Valid Values*
|
node | computer system name that is valid for the remote event query Valid Values |
origin | application instance or class name that is valid for the remote event query Valid Values |
pattern | character string within the event description field that is valid for the remote event query Valid Values |
IDrange | string that defines the range of PATROL event IDs that are valid for the remote event query Valid Values |
class | event class that is valid for the remote event query Valid Values |
severity | string containing the integer event severity that is valid for the remote event query. Optional parameter. Valid Values |
Description
The remote_event_query() function returns a list of up to maxcount events found in the remote PATROL Agent Event Manager repository that match the filter criteria. The session to the remote PATROL Agent is identified by sessionID. The returned events are formatted as specified by format.
The remote_event_query() function returns the NULL string if no events were found in the event repository that match the filter criteria.
Specifying the remote_event_query() Output Format
The remote_event_query() function format parameter is similar to the specification string used for the standard C library printf() function. The format parameter can contain alphanumeric characters for use as titles and field names, and string literals for spacing, tabbing, and carriage control.
PATROL macro variables within the format parameter identify the fields that the remote_event_query() function returns. The following table describes the macro variables available to the remote_event_query() function.
Example
The following is an example of the remote_event_query() function:
"The result of the remote query\n",
remote_event_query(
mysession, # session handle returned by remote_open
"100", # return a maximum of 100 events
"1", # call will time out in one minute
"\n\n", # separate each event with two newline characters
# event output format
"event ID: %{EV_ID}\nevent type: %{EV_TYPE}\n".description: %{EV_DESC}",
"", # event filter: any start time
"", # event filter: any end time
"O", # event filter: only OPEN status
"A,W", # event filter: only ALARM AND WARNING states
"", # event filter: any node
"ORACLE", # event filter: ORACLE as an originating application
"", # event filter: any pattern in the event description
"-/-", # event filter: all events regardless of ID range
"" # event filter: any event class
)
. "\n"
);