jasbali.blogg.se

Linux cpu monitoring
Linux cpu monitoring






linux cpu monitoring

To build the script we are going to use shell commands.īelow is the script that we are going to use to help us monitor the CPU usage, this will help you monitor Ubuntu versions like 20.04 or 22.04 or RedHat distros.

linux cpu monitoring

Having all of this in an email will help us better understand what is happening on the server we have. Top 10 Processes that consume high CPU using the ps command.In this article, we will configure a script that will run in crontab every 5 minutes and check to see if the CPU usage is above 80% in case that will happen you will be notified via email with the: For more details on Hetzner, you can check this review. In case you are using an online VPS provider like Hetzner or DigitalOcean having such a script can be very useful as it can catch problems coming from your hosting provider or your app. You would want to be notified via email in case the CPU usage spikes and you need to do some checks.įor your server to be able to send emails you will need to have configured an SMTP Relay or you should have an email server hosted on the VPS that will send the alarm. Monitoring the CPU is very important on a Linux server as there may be cases when your applications will need more CPU and can consume everything.








Linux cpu monitoring