How to delete an alert event

kapacitor

#1

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,


#2

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: https://docs.influxdata.com/kapacitor/v1.5/working/cli_client/

Best Regards,
dg


#3

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: https://github.com/influxdata/kapacitor/issues/88 ths following command:

kapacitor delete tasks event

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

Please advise.


#4

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

#5

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,


#6

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


#7

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,