I have the following stick script
stream
|from()
.measurement('mymetric_value')
|deadman(1.0, 10s)
.message('service is down!')
.log('/tmp/alerts.log')
.email('[email protected]')
It send an alert every 10 seconds that the service is down. How can I set it to send only one?
There is a property method stateChangesOnly()
on Alert nodes in a TICKscript that will only issue an alert if the state of the alert changes. Your script would look like this:
stream
|from()
.measurement('mymetric_value')
|deadman(1.0, 10s)
.message('service is down!')
.log('/tmp/alerts.log')
.email('[email protected]')
.stateChangesOnly()
See the kapacitor documentation on stateChangeOnly() for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With