Use the following method to create a state configuration group and to add it to the whole set of groups:
public boolean createStateConfigurationGroup(String groupName, String descriptionID, String description, int dataCollectionType, int periodValue, int periodUnit, int reactOnCollectionFailure, String[] greenStates, String[] yellowStates, String[] redStates, String unit, int alertMode);
The following parameters are available:
-
groupName - the name of the group. The length of this string must not exceed 40 characters, otherwise this group will not be sent to the CCMS.
-
descriptionID - description IDs must be unique. The length of the string must not exceed 30 characters.
-
description - a brief explanation about this group.
-
dataCollectionType - defines the way the data is retrieved from the resource.
There are two possibilities:
- Passive reporting (the resource is triggered by timer) - in this case, use com.sap.engine.interfaces.monitor.MonitorConstants.POLLED_BY_MONITOR.
- Active reporting (the resource sends notifications) - in this case, use com.sap.engine.interfaces.monitor.MonitorConstants.PUSHED_BY_RESOURCE.
-
periodValue - if dataCollectionType is POLLED_BY_MONITOR, this parameter defines the period value of polling data. If dataCollectionType is PUSHED_BY_RESOURCE, this parameter is ignored.
-
periodUnit - if dataCollectionType is POLLED_BY_MONITOR, this parameter defines the unit of the period. There are three possibilities:
- com.sap.engine.interfaces.monitor.MonitorConstants.MINUTE
- com.sap.engine.interfaces.monitor.MonitorConstants.HOUR
- com.sap.engine.interfaces.monitor.MonitorConstants.DAY
If dataCollectionType is PUSHED_BY_RESOURCE, this parameter is ignored.
-
reactOnCollectionFailure - defines how a monitor that belongs to this group must react when the resource fails.
There are two possibilities:
- com.sap.engine.interfaces.monitor.MonitorConstants.UNREGISTER_MONITOR - the monitor, which belongs to this group, unregisters itself and stops monitoring the resource.
- com.sap.engine.interfaces.monitor.MonitorConstants.IGNORE - the monitor ignores the problems and remains registered to monitor the resource.
-
greenStates - defines green color states for this group
-
yellowStates - defines yellow color states for this group
-
redStates - defines red color states for this group
-
unit - represents a particular unit for the group, for example "bytes", "MB", and so on. Units whose names have more than 4 symbols are cut to 4 symbols when they are sent to the CCMS.
-
alertMode - defines the alert types. Has an effect only in the CCMS.
There are several possibilities:
- com.sap.engine.interfaces.monitor.MonitorConstants.ALWAYS
- com.sap.engine.interfaces.monitor.MonitorConstants.NEVER
- com.sap.engine.interfaces.monitor.MonitorConstants.ON_STATE_COLOR_CHANGE
- com.sap.engine.interfaces.monitor.MonitorConstants.ON_STATE_TEXT_CHANGE
This method returns true if the group is created and added to the whole set of groups successfully; otherwise it returns false.
Tip
boolean result = monitorContext.createStateConfigurationGroup(stateGroupName, "TEST.STATE.GROUP", "Test state rate configuration group",
MonitorConstants.POLLED_BY_MONITOR, 8, MonitorConstants.MINUTE, MonitorConstants.UNREGISTER_MONITOR,
new String[]{"a"},new String[]{"b"} , new String[]{"c"},
"",0);