Idea ID: 1682625

Enable adding of additional event information in custom monitor SDK per metric

Status : Waiting for Votes
Waiting for Votes
See status update history
over 2 years ago

Hello,

we are creating custom monitors with com.hp.sitescope.monitors.sdk and forwarding events to Omi/OBM.
Java doc can be found on SiteScope installation server in "/opt/HP/SiteScope/examples/monitors/custom/doc/javadoc.zip".
Those events are triggered and forwarded based on thresholds per metric.
The metric is going into alarm or warning state and an event will be triggered as well forwarded to OMi/OBM.

We are missing a function to add more detailed information into event description like for events created using Operations Agent.
E.g. we want to create a own logfile monitor for Oracle alert.log and we need to add the error text from logfile into events.

There is an existing field called "_instructiontxt" which can be assigned to any event field but which only can be filled in a static way on a per monitor basis, however, we would need to set it per metric.
Thus, we need a function to set such field using com.hp.sitescope.monitors.sdk and to transfer this into event description.

Such additional event information must be added only if an event will be created based on threshold setting per metric. Ideally we would like to provide the additional event information (e.g. more detailed information about the reason of a detected error or warning situation only when upon setting a given metric value an associated threshold setting is breached since providing additional event information for each and every counter in advance might have a bad impact on monitor execution performance (monitor run time).

Maybe below schematic piece of code could present a feasible solution approach:

### Suggested solution approach ###

Suggested SiteScope Custom Monitor API method signatures:

boolean setValue(String metricName, double metricValue);
boolean setValue(String metricName, String metricValue);
boolean setValueAndCIHint(String metricName, double metricValue, String metricCIHint);
boolean setValueAndCIHint(String metricName, String metricValue, String metricCIHint);

// Above methods would only return true if any of the thresholds associated with <metricName> will be breached due to setting <metricValue>.

void setAnnotation(String metricName, String eventAnnotation); // annotation would be the additional event information which this enhancement request is all about

Code example which we can imagine then to implement in our custom monitors:

if (setValue("FreeSpace %", 99.0)) {
 String eventAnnotation = <return value of a method which queries e.g. a list of tablespaces with current space consumption from the database being monitored by the custom monitor>
 setAnnotation("FreeSpace %", eventAnnotation);
}

BR

Andreas