int VCSAgGetMonitorLevel(int *level_one, int *level_two);
The agent developer can use this primitive to query if the LevelOne (Basic) monitoring or the LevelTwo (Detail) monitoring or both need to be scheduled.
Output parameters:
level_one - This parameter will be updated to 1 or 0. The value of 0 indicates that the basic monitoring should not be scheduled. And the value of 1 indicates that the basic monitoring should be scheduled.
See IMF.
level_two - This parameter will be updated to 0, 1, or 2 . The value of 0 indicates that the detail monitoring should not be scheduled, and the value of 1 indicates that the detail monitoring should be scheduled. And the value of 2 indicates that the detail monitoring should be scheduled if basic monitoring (level_ one) reports the state as online in current running monitor.
Return values: It can be set to VCSAgSuccess or VCSAgFailure based on whether the api passes or fails.
The following example outlines the process of setting the output parameters:
For example, if you set LevelTwoMonitorFrequency to 5 and the resource state is ONLINE, then every fifth monitor cycle, level_two will have the value as 1. If the resource state is OFFLINE, then every monitor cycle level_two will have the value as 2.
See LevelTwoMonitorFreq.
If you set MonitorFreq to 5 and the resource is registered with IMF, then every fifth monitor cycle level_one parameter will have the value of 1.
See IMF.
Usage:
int ret = VCSAgFailure; ret = VCSAgGetMonitorLevel(&level_one, &level_two);