Set alerts for when cpu load , hard disk reaches 85 % in grafana , datasource using : prometheus

Please help and send me the query i am new on grafana

Welcome. How about you post here what you have already tried? Then, perhaps, one of the many members will offer some feedback or guidance.

I suggest using node-exporter and its already built dashboard which you can import using code 1860.

Does that dashboard include alerts?

@parsapahlavany i am using node exporter json export dashboard but there is predefined dashboard.now i want create a dashboard where i want set cpu usage alert when it reaches 80%.I need a query for cpu data %.

And also i want creat alert for disk as well when it reaches 90% (usage). So how i will create alert and how to write query for disk % and cpu % for linus system using node exporter and prometheus.

@yosiasz Yes, dashboard has a alert.

So i am using node exporter and i want to set alert when cpu load reachs 80% and disk usage (/data) reaches 90%.How i will create alert in grafana for cpu load and disk usage.please help.

1 Like

sorry my question was for @parsapahlavany he recommended dashboard 1860 and I was asking him if that dashboard has alerts

1 Like

No, but the query is there and can be used to create a custom alert in a new dashboard of his willing. That’s why I mentioned the node exporter dashboard because it’s a full set of queries needed.

so the OP’s original question is about alerts

The query is inside each panel of node exporter full dashboard.
Create a new dashboard, copy the query from the panel you want into a panel in this new dashboard, and then set the alert with the condition you want it.

@parsapahlavany query is available but the query is not working in % condition.lets supose i have copy the query and create a dashboard but when i am creating the alert in new dashboard for cpu load when it reach 90% so what condition i will set for 90% because in my new dashboard the cpu load data not showing in % value it showing something like 23565… so how to mejor the alert thresold 90%.

If you have query for cpu load 90% reach then firing the alert pls share with me and how to creat new dashboard with y value percentage and the data will show in hower on % value.

And pls share the same for disk usage 90%.

This is what I’m using:
The query for cpu usage:

100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[1m])) * 100)

and make sure to set “unit” to “Percent (0-100)” in the Axes section.

The query for disk usage:

max(100 - ((node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes)) by (instance)

hope this works.

1 Like

@parsapahlavany both query are working but we have multiple server and there multiple mount point.If i want to segregate the mount point with their server then what i will add in query like i have prod_server1 and prod_server2 and and their moints are /root and /data.

(prod_server1 mountpoint: /root ) (prod_server2 mountpoint: /data)

So how i will create the graph for prode_server1 and their mount points like /root and /data in single graph and when both mount point reach 90% usage then alert should be trigger.

So how i will create the graph for prode_server2 and their mount points like /root and /data in single graph and when both mount point reach 90% usage then alert should be trigger.

pls help

I didn’t catch you 100% but have you tried adding these mount points as targets in prometheus config file?
Or defining another data source in grafana and using 2 panels/queries for each mount point?

1 Like

@parsapahlavany supose we have two instance where node exporter running.We have configure data source (prometheus)in grafana.

Now we have created two dashboard for server1 monitoring its only disk usage and cpu usage.

First we will create a dashboard for cpu usage and set alert when it reaches 90%.

Then we will creat another dashboard for disk usage and set alert when it reaches 90%.

Now we will create same dashboard for another instance.

Basically i want segrigate the query for both the instance.

Also segrigate mount points.

I had the same issue while setting up alert. This blog is gem :pinched_fingers:

1 Like