0
votes

I am using Prometheus monitoring to monitor couple of nodes(virtual machines). I am trying to write a alert rule i.e if avg of all cpu cores usage in the last 24 hours is less than a threshold value then fire the alert for the same.. (basically if a virtual machine has been idle all along in the last 24 hours then fire alert).

For this i want to create a record rule to record the data for last 24 hours and then i want to create an alert to analyse the last 24 hours data and fire alert if the query is true).

what should be the rules yaml file for that.

1

1 Answers

0
votes

I recommend you check the next page:

https://awesome-prometheus-alerts.grep.to/

You have some basic alerts for node-exporter (CPU, RAM, disk, network, systemd...):

https://awesome-prometheus-alerts.grep.to/rules#host-and-hardware

Enjoy!