Forum Discussion

mmatec01's avatar
mmatec01
Icon for Neophyte rankNeophyte
3 years ago

Include text in custom alert message - workarounds wanted

So I am crafting a custom Alert message for my custom in house written DS.  Everything is working fine.  The thing is I would like to pass a text into my Alert if the exception issue is detected.  Detection is easy - a numeric value will be evaluated against threshold.  However in my message, besides standard Tokens, like ##INSTANCE## and ##VALUE## there is no way to specify STDOUT which contains my alert message, the informational text with findings.  This is well known fact, a shortcoming.  No way for callbacks of any kind.
So, workarounds....
In my Auto Discovery (AD) I can easily set Description of the instance to the value of alert message.  Or I can set any auto.xxx properties for this instance.  For example I set auto.instance.alert.description instance property.  And then use the token ##AUTO.INSTANCE.ALERT.DESCRIPTION## in my custom Alert message during Collection. That works great! However...
My AD runs every hour and my collection runs every 5 minutes.  Meaning is the issue is detected in between AD runs my instance description or my custom instance property will not be set to current value.  Bummer.
Another workaround perhaps....if the issue is detected during collection, run another script which will trigger autodiscovery on device, via API. Again, that works. But that seems like overkill if I only want to update the particular instance of one DS.  I don't need to update all DSs, all instances on entire device...
Another workaround perhaps....if the issue is detected during collection, run another script which will update a particular device property, via API.  There is a documentation for updating a property for device and that works great, but I am not sure if and how this works for Device Instance properties, especially any auto.xxx and system.xxx properties.  I am not having any luck with that.

Any advice?

  • Anonymous's avatar
    Anonymous

    Would it help if alerts could trigger scripted actions? If an alert is opened, run this groovy script on the collector and grab the output? I've seen similar things where for example, you do a traceroute when a ping fails.

  • Thank you Stuart, that would definitely be one of the workarounds.  Are you talking about Groovy Complex Datapoints where you have access to the raw data payload and you can use Groovy variable 'output' (well, depending on collection method)?  I have seen the description of of it but never actually used it.  I guess I will look around for an example, or test it.  Thanks again.

  • Anonymous's avatar
    Anonymous

    I'm describing a feature that doesn't yet exist. Where the state change of an alert (null -> open, open -> ack, open -> close, etc.) could trigger scripted actions, the result of which would be fed back into the alert (or linked from the alert as a child object since you might have it run multiple times). 

    Groovy complex datapoints would be a workaround, yes.