Monitor individual processes on Ubuntu 22.04 VM

Bryce I 111 Reputation points
2024-04-05T21:12:53.2533333+00:00

Hello-

I would like to set up ongoing monitoring of the individual processes on my Ubuntu 22.04 virtual machine. I have been having intermittent issues with high CPU utilization by specific processes, i.e. mysql, and would like to monitor and, when necessary, alert via email.

Is this supported on Ubuntu 22.04? If so, could you please direct me to reasonably concise directions?

Thanks much!

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,658 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,036 questions
{count} votes

1 answer

Sort by: Most helpful
  1. S.Sengupta 24,636 Reputation points MVP
    2024-04-06T01:40:57.38+00:00

    Monitoring individual processes and setting up email alerts is achievable on Ubuntu 22.04.

    ps, mail (pre-installed on Ubuntu)

    Create a script (e.g., monitor_process.sh) it gathers process information (CPU usage) using ps aux | grep <process_name>

    use the mail command to send an email notification if CPU usage exceeds 80%

    Use Cron, which is a time-based job scheduler in Unix-like operating systems. It allows you to schedule jobs to run at specific times or intervals. This can be useful for automating tasks such as backups, system updates, and data processing.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.