8.3.2 Monitor any event (event monitor item)
- Organization of this subsection
(1) Overview of the function
This item executes a command periodically and monitors the return code of the command.
(2) List of settings
Name |
Required |
Format |
Can specify inherited information? |
---|---|---|---|
Command name |
Yes |
String (1 to 255 bytes) |
Yes |
Parameter |
No |
String (0 to 512 bytes) |
Yes |
Return code regarding to monitor event |
Yes |
String (1 to 512 bytes) Format: numeric-value[,numeric-value...] The valid values are 0 to 4,294,967,295. |
Yes |
Return code regarding to monitor abnormal end |
No |
String (0 to 512 bytes) Format: numeric-value[,numeric-value...] The valid values are 0 to 4,294,967,295. |
Yes |
Timeout period(min.) |
No |
Numeric (0 to 1440) |
No |
Virtual user name |
No |
String (0 to 512 bytes) |
Yes (The profile information cannot be specified.) |
(3) Settings
- Command name
-
Specify the file name of the command to be executed periodically for monitoring.
- Parameter
-
Specify the parameter for the execution command.
- Return code regarding to monitor event
-
Specify the return codes that are regarded as event detection. You can specify multiple return codes, separated by commas.
- Return code regarding to monitor abnormal end
-
Specify the return codes that are regarded as abnormal ends. You can specify multiple return codes, separated by commas.
- Timeout period(min.)
-
Specify the timeout period for the Monitor any event. If omitted or set to 0, the Monitor any event is not terminated.
When the timeout period is reached, the monitor ends abnormally (ENDE).
- Virtual user name
-
Specify the name of the virtual user mapped to the name of the Windows user who executes the item. If the virtual user name is omitted, the item is executed with the account for the CPA job execution service.
To map the virtual user name, use the cpasetumap command. For details on the cpasetumap command, see cpasetumap in 9. Commands.
(4) Return values
Value |
Description |
---|---|
-1 |
Forced termination. |
0 |
One of the following cases:
|
2 |
Insufficient resources or high processing load.
|
3 |
System call failed.
|
4 |
An incorrect parameter was specified.
|
21 |
The execution result of the command matched the setting values of the Return code regarding to monitor abnormal end, and the monitor event item ended. |
22 |
An attempt to execute the specified command failed.
|
(5) Example 1
Detect an event if a certain process exists. Otherwise, continue monitoring.
Command name |
cmd |
Parameter |
/c tasklist|findstr process-name |
Return code regarding to monitor event |
0 |
Return code regarding to monitor abnormal end |
-- |
- Legend:
-
-- : Not specified
(6) Example 2
Detect an event if a certain process exists. Otherwise, end abnormally.
Command name |
cmd |
Parameter |
/c tasklist|findstr process-name |
Return code regarding to monitor event |
0 |
Return code regarding to monitor abnormal end |
1 |
(7) About return codes
If the same value is set to both of the Return code regarding to monitor event and the Return code regarding to monitor abnormal end, the item ends abnormally.