How to Monitor DigitalOcean VPS

Cara Monitoring VPS DigitalOcean

Monitoring server resources such as RAM, CPU, disk, and network. This is done to find out how much use of these resources. Based on the resource usage data that we get from the monitoring results, we can easily make decisions to increase or decrease server capacity, especially VPS.

Get started on DigitalOcean with $200, 60-day credit for new users.

DigitalOcean VPS users can monitor Bandwidth, CPU and Disk I/O usage via the Droplet Name->Graphs page.

Graphs droplet DigitalOcean
Graphs droplet DigitalOcean

These graphs can still be added with Load, Memory, and Disk Usage monitoring by installing the Metric agent.

Install do-agent

Download the do-agent installer.

Run the installer.

Check the do-agent installation results.

Check the Graphs page again.

Alert Policies

Alert Policies is a feature at DigitalOcean that can send notifications to email and Slack when resource usage in a droplet reaches its limit and occurs in an interval of at least 5 minutes to 1 hour.

For example, we want DigitalOcean to send a notification when CPU usage has reached the limit above 80% for 5 minutes.

Open Alert Policies, click the menu Create->Alert Policies.

At Select metric & set threshold, select CPU, is above, 80%, 5 min.

At Select Droplets or Tags, enter a droplet or tag.

At Send alerts via, check the email, and click Connect Slack if you want to send a notification to Slack.

Create alert policy
Create alert policy

Finally, at Name and create alert policy, enter a name for the alert policy, and click Create alert policy.

Name of alert policy
Name of alert policy

Alert Policy Testing

To test the alert policy, whether it successfully sends a notification to the email or not, we have to force the CPU to work up to above 80% for 5 minutes. We can use Stress, a tool for stress testing systems, running large workloads.

Install stress on Debian or Ubuntu.

Install stress on CentOS.

Run stress for CPUs with 1 core.

Stress will make the CPU work up to 100%. See CPU usage in Graphs.

Graphs - CPU Usage
Graphs – CPU Usage

The notification will be sent after 5 minutes.

Email notification - monitoring triggered
Email notification – monitoring triggered

To stop Stress, press CTRL + C.

Another notification is sent when the CPU usage is below 80%.

Email notification - monitoring resolved
Email notification – monitoring resolved

If you found this article helpful and would like to support my work, consider making a donation through PayPal. Your support helps me continue creating useful content and tutorials. Thank you!

Donate via PayPal: https://paypal.me/musaamin

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *