Setting Up Custom Alerts in Glances
To change how Glances works, you'll use a file named glances.conf
. For Linux systems, save this file in one of these locations: ~/.config/glances
or /etc/glances
. If these folders don’t exist, you’ll need to create them.
Setting Custom Alerts:
If you want Glances to warn you at specific values, not just the defaults, you need to set these in the glances.conf
file. For example, to change the alert levels for CPU usage, you can adjust the [cpu] section like this:
You can change these settings by opening the configuration file. Use the command nano ~/.config/glances/glances.conf
or nano /etc/glances/glances.conf
to edit the file.
[cpu]
user_careful=50
user_warning=70
user_critical=90
iowait_careful=50
iowait_warning=70
iowait_critical=90
system_careful=50
system_warning=70
system_critical=90
steal_careful=50
steal_warning=70
steal_critical=90
Explanation of Alert Levels:
- user_careful: The CPU usage percentage at which you should be alert (e.g., 50%).
- user_warning: The CPU usage percentage at which you should start taking action (e.g., 70%).
- user_critical: The CPU usage percentage at which immediate intervention is required (e.g., 90%).
- iowait_careful: The I/O wait time percentage at which you should begin to pay attention (e.g., 50%).
- iowait_warning: The I/O wait time percentage at which you should consider addressing potential problems (e.g., 70%).
- iowait_critical: The I/O wait time percentage at which urgent action is needed (e.g., 90%).
- System_careful: The overall system usage percentage at which you should monitor more closely (e.g., 50%).
- system_warning: The overall system usage percentage at which action should be taken to prevent issues (e.g., 70%).
- system_critical: The overall system usage percentage at which immediate action is crucial (e.g., 90%).
- steal_careful: The CPU steal time percentage at which you should be aware of possible performance impacts (e.g., 50%).
- steal_warning: The CPU steal time percentage at which you should start addressing performance issues (e.g., 70%).
- steal_critical: The CPU steal time percentage at which urgent measures are necessary (e.g., 90%).
Feel free to change these numbers to what you need. You can also set similar custom alerts for other sections like memory, I/O, and network by editing the same file. For further details, visit the official Glances documentation.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS