How to delete an alert event

Hi,

We are using Kapacitor to generate alerts for several services.
Using this command on CLI : kapacitor show-topic main:v_trigger_reachable:alert5
Result is:
ID: main:v_trigger_reachable:alert5
Level: CRITICAL
Collected: 0
Handlers: []
Events:
Event Level Message Date
reachable front002 CRITICAL CRITICAL Host front002 is dead. Time=2018-07-20 11:36:00 +0000 UTC 20 Jul 18 11:36 UTC
reachable back003 CRITICAL CRITICAL Host back003 is dead. Time=2018-07-20 11:36:00 +0000 UTC

As those hosts don’t exist anymore, we would like to delete those events (not sure the term is right), but we don’t know how to proceed. Does someone have a clue how to do it ?

Best regards,

1 Like

Just like the show topic command, you can use delete topic to delete it once you’re no longer interested in it. See the full Kapacitor on-line CLI docs here: Kapacitor command line client | Kapacitor 1.5 Documentation

Best Regards,
dg

Hi,

Thanks for the reply.
Based on my knowledge, if we delete the topic, we will loose all the alert history of the topic, not just the particular event that is annoying us.
WE continue digging the internet with that request and saw on this site: Bug: "kapacitor delete <task>" is not working · Issue #88 · influxdata/kapacitor · GitHub ths following command:

kapacitor delete tasks event

But this seems not working or at least not responding to our needs.

Please advise.

Maybe disable is what you want:

$ kapacitor disable

Must pass at least one task ID
Usage: kapacitor disable [task ID…]

Disable and stop a task running.

For example:

You can disable by specific task ID.

	$ kapacitor disable cpu_alert

Or, you can disable by glob:

	$ kapacitor disable *_alert

Hi,

thanks for your help.
Nevertheless, this will stop the task, but not clear the event. This does not seems to solve our current issue.

Best regards,

So then, to be clear, you want to clear the event, but still have the event history available? I believe that you can either delete the event, in which case the history goes with it, or you can keep the history by disabling the event.

I guess it would also be possible to write a query to pull all the event history out, and re-store it under a different measurement, and then delete the event.

Best Regards,
dg

Hi,

Sorry for late response.
Maybe I should talk about our needs.
On a alert, we have for example disk space > 80% alerts for all our servers. When a server is shutdown, we still have the last event in kapacitor. If possible, we would like to handle this case in kapacitor.
Deleting everything, filtering and recreating seems to us a big work for such an little need.

Best regards,

We have a similar problem - when a host is not submitting measurements, kapacitor raises a deadman event based on the system measurement - this will be resent every 5 minutes.
When a host is decommissioned we cannot delete the alert event from kapacitor.