Use the following method to create a configuration group and to add it to the whole set of groups:
public boolean createConfigConfigurationGroup(String groupName, String descriptionID, String description, int dataCollectionType, int periodValue, int periodUnit, int reactOnCollectionFailure);
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 the 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
¡ com.sap.engine.interfaces.monitor.MonitorConstants.IGNORE
This method returns true if the group is created and added to the whole set of groups successfully; otherwise it returns false.
boolean result = monitorContext.createConfigConfigurationGroup(configGroupName, "TEST.CONFIG.GROUP", "Test config configuration group", MonitorConstants.POLLED_BY_MONITOR, 8, MonitorConstants.MINUTE, MonitorConstants.UNREGISTER_MONITOR); |