Last active
December 16, 2016 16:18
-
-
Save zshamrock/6cd9427db5e9f8b803988a0c8c4fa327 to your computer and use it in GitHub Desktop.
CPU Alert TICK script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream | |
// Select just the cpu measurement from our example database. | |
|from() | |
.measurement('cpu') | |
|alert() | |
.message('{{ .Level }}: CPU idle usage is above 80% threshold @ {{ index .Tags "host" }}') | |
.crit(lambda: "usage_idle" > 80) | |
// Whenever we get an alert write it to a file. | |
.log('/var/log/alerts.log') | |
// And send a notification to Slack | |
.slack() | |
.channel('#influx-alerts') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment