It’s important to monitor your server, especially when you’re running mission-critical applications or serving the web. If you are running Ubuntu 24.04, the most useful tools to monitor server health include Netdata and Prometheus. Regardless of whether you go with Netdata because of its ease of use and real-time features, Prometheus because it’s enterprise-scale monitoring, or with the out-of-the-box Ubuntu tools because it is so lightweight, the most important thing is that your monitoring solution is tailored to suit your needs and environment.
This tutorial will guide you through the process of monitoring server health on Ubuntu 24.04, using Netdata or Prometheus. Everything from installing and configuring to best practices.
Table of Contents
- Why Server Monitoring Matters
- Method 1: Monitor Server Health on Ubuntu 24.04 with Netdata
- Method 2: Monitor Server Health Ubuntu 24.04 with Prometheus
- Troubleshooting Missing Metrics
- Final Thoughts
Why Server Monitoring Matters
Monitoring server health on Ubuntu 24.04 to always ensure good server performance, avoid downtime. Server health monitoring helps you:
- Avoid Downtime: Identify when things go wrong, before they cause downtime
- Performance Tuning: Highlight resource bottlenecks and optimization potentials
- Protect Yourself: Watch for any strange activity patterns
- Planning Capacity: It helps you make decisions based on volume and scaling of resources
- Prevent SLA violation: Satisfy SLA with non-reactive but proactive monitoring
Method 1: Monitor Server Health on Ubuntu 24.04 with Netdata
Netdata is a monitoring service with a real-time interactive web interface running on the server, and you can view a similar dashboard which can be viewed on its server with low resource usage. Because it’s good for quick, at-a-glance looks at server health that are visually rich. Let’s monitor server health on Ubuntu 24.04 with Netdata:
Step 1: Install Netdata on Ubuntu 24.04
Netdata is perfect for monitoring real-time performance: it does it out of the box, no configuration required, gorgeous web dashboards, and unparalleled performance. Type the following in your terminal:
sudo apt update sudo apt install netdata

It installs the stable Netdata version. There may be an older version available with the APT method.
Step 2: Access Netdata Dashboard
Once installed, you can navigate to your browser and:
http://your_server_ip:19999

Netdata installs a local web server on port 19999 when it’s installed. The dashboard gives you: Live graphs of CPU, RAM, disk, and network usage. Monitoring for systemd services, MySQL, Nginx, Docker, etc. Auto-refreshing charts every second.
You’ll see live charts for:
- CPU usage and load
- Memory and swap utilization
- Disk I/O and space usage
- Network traffic
- System processes
- Application-specific metrics

Note: I would recommend adding a reverse proxy with authentication if exposed on a public server.
Step 3: Configure Alerts and Notifications (Optional)
Edit the Netdata alert notification configuration file. To enable alerts, edit:
sudo nano /etc/netdata/health_alarm_notify.conf
Configure SMTP settings:
# Email configuration DEFAULT_RECIPIENT_EMAIL="admin@yourdomain.com" EMAIL_SENDER="netdata@yourdomain.com" # SMTP settings SEND_EMAIL="YES" SMTP_SERVER="smtp.gmail.com" SMTP_PORT="587" SMTP_USERNAME="your-email@gmail.com" SMTP_PASSWORD="your-app-password"
Channels can be turned on, and you can tweak thresholds for any health check. Then restart Netdata:
sudo systemctl restart netdata

Pros of Using Netdata
- Quick installation
- Real-time visualization
- Low resource usage
- Minimal setup
Netdata supports alerting through: Email, Slack, Telegram, Discord, and Webhooks.
Method 2: Monitor Server Health on Ubuntu 24.04 with Prometheus
Prometheus is a powerful, open-source monitoring system that collects metrics from your services and secondly, it stores these metrics in its internal database, which can be accessed for monitoring and alerting. It is based on time-series data and can drive Dashboards.
Step 1: Install Prometheus
Prometheus provides powerful querying and long-term storage of metrics. You’re installing the latest version of Prometheus from GitHub and creating directories where Prometheus will place its config and time-series database. Users who are serious about security discipline permissions.
Create a user and directories:
Let’s create a dedicated user:
sudo useradd --no-create-home --shell /bin/false prometheus sudo mkdir /etc/prometheus /var/lib/prometheus

Download and install Prometheus:
Prometheus is a powerful, open-source monitoring system. It is a great system for collecting time-series metrics and excels at scale. Let’s download and install it:
cd /tmp wget https://github.com/prometheus/prometheus/releases/download/v2.52.0/prometheus-2.52.0.linux-amd64.tar.gz

After downloading the file, let’s extract it in the tmp directory:
tar xvf prometheus-2.52.0.linux-amd64.tar.gz

After that, navigate to the particular directory and copy the extracted file into the bin subdirectory as below:
cd prometheus-2.52.0.linux-amd64 sudo cp prometheus promtool /usr/local/bin/

Finally, move config files:
sudo cp -r consoles/ console_libraries/ /etc/prometheus sudo cp prometheus.yml /etc/prometheus

After that, set ownership with the chown utility as below:
sudo chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus

Step 2: Set Up Prometheus as a Systemd Service
You’re instructing systemd how to handle Prometheus as a service running in the background. The binary configuration path and storage path are defined in ExecStart.
sudo nano /etc/systemd/system/prometheus.service
Paste this config:
[Unit] Description=Prometheus Wants=network-online.target After=network-online.target [Service] User=prometheus ExecStart=/usr/local/bin/prometheus \ --config.file=/etc/prometheus/prometheus.yml \ --storage.tsdb.path=/var/lib/prometheus/ [Install] WantedBy=default.target

Enable and Start
Systemd also takes care of starting Prometheus at boot and continuously runs it. Then enable and start Prometheus:
sudo systemctl daemon-reexec sudo systemctl enable prometheus sudo systemctl start prometheus

Step 3: Access Prometheus Dashboard
Prometheus Web UI is a place where you can make queries for any metrics, view different time-series data, and check your active targets. It is the main control portal for Prometheus. Go to:
http://your_server_ip:9090

You’ll get a UI where you can execute queries, see metrics, and inspect system targets.
The Prometheus UI lets you:
- Query real-time and historical metrics
- Explore data collected from targets
- Check configuration and system status

Look at the top of the Prometheus UI, and you will see a field titled “Expression”.
- up – pings each target to see if it is online.
- node_cpu_seconds_total – displays the CPU usage and since when it has been running.
- node_memory_MemAvailable_bytes – shows available memory.
- node_load1 – 1-minute system load average.
- node_filesystem_free_bytes – which displays available disk space.
Click Execute.

You’ll see two tabs:
- Table: Present raw metrics as rows.
- Graph: Displays data visually over time.
Prometheus is not only a collector of data, but it also allows you to query, filter, and visualize that data. With PromQL, you can monitor anything from real-time CPU usage to historical memory patterns, and you’ll have total visibility for server health.
Troubleshooting Missing Metrics
Make sure you have a Node Exporter or other exporters running and listening (port 9100). You can check Prometheus. yml for correct scrape_configs. Also, restart the Prometheus after the changes in the config:
sudo systemctl restart prometheus
With this thorough guide, you now have monitoring to ensure you’ve got healthy, performant Ubuntu 24.04 servers.
Final Thoughts
Monitoring the health of your server in your Ubuntu 24.04 running system is crucial for performance and stability. Netdata is great for live monitoring of a system, whereas Prometheus is great for gathering, storing, and querying metrics over the long term. Whether you’re trying to maximize simplicity or scale up your server, this guide provides all the tips and tools you need to keep your server running efficiently.
from StarWind Blog https://ift.tt/hzdHD0W
via IFTTT
No comments:
Post a Comment