Skip to content

Alerting Rule for High CPU

Video Lecture

Alerting Rule for High CPU Alerting Rule for High CPU

 (Pay Per View)

You can use PayPal to purchase a one time viewing of this video for $1.49 USD.

Pay Per View Terms

  • One viewing session of this video will cost the equivalent of $1.49 USD in your currency.
  • After successful purchase, the video will automatically start playing.
  • You can pause, replay and go fullscreen as many times as needed in one single session for up to an hour.
  • Do not refresh the browser since it will invalidate the session.
  • If you want longer-term access to all videos, consider purchasing full access through Udemy or YouTube Memberships instead.
  • This Pay Per View option does not permit downloading this video for later viewing or sharing.
  • All videos are Copyright © 2019-2025 Sean Bradley, all rights reserved.

Description

We will create an alerting rule for high CPU usage reported by any of our node exporters.

The query used in the alert rule was,

rate(node_cpu_seconds_total{job="node",mode="user"}[$__rate_interval]) * 100

The above query will convert the node_cpu_seconds_total value to a percentage for all of my node exporters where the job equals node.

The threshold was configured to be true when the input A is above 50.

To simulate high CPU on a Linux server, you can use a tool called stress.

To install,

#
apt install stress

To simulate high CPU usage on CPU 1, use the command,

#
stress -c 1