Set Up Server Resource Monitoring on RHEL 9: Complete Tutorial

By Raman Kumar

Share:

Updated on May 03, 2026

Set Up Server Resource Monitoring on RHEL 9: Complete Tutorial

Why RHEL 9 Resource Monitoring Matters for Hosting Providers

Server resource monitoring RHEL 9 becomes critical when you're managing customer workloads, handling support tickets, or preventing outages before they affect revenue. Unlike basic uptime checks, comprehensive monitoring shows you CPU spikes, memory pressure, disk bottlenecks, and network saturation patterns that hurt customer sites.

This tutorial covers three monitoring layers: command-line tools for immediate diagnosis, system statistics for trend analysis, and web-based dashboards for ongoing observation. Each serves different scenarios in a hosting environment.

We'll focus on tools that work reliably in production RHEL 9 environments without heavy overhead. Hostperl VPS customers often need this setup when scaling beyond basic shared hosting packages.

Installing Essential Monitoring Tools on RHEL 9

Start by updating your system and installing the core monitoring utilities. RHEL 9 includes some tools by default, but you'll need additional packages for comprehensive monitoring:

sudo dnf update -y
sudo dnf install htop iotop sysstat nethogs iftop -y

Enable the sysstat service to collect system statistics automatically:

sudo systemctl enable --now sysstat

This command starts collecting CPU, memory, disk, and network statistics every 10 minutes. The data gets stored in /var/log/sa/ for historical analysis.

Configure htop for Real-Time Process Monitoring

htop provides an interactive view of running processes with color coding and easy sorting. Launch it with:

htop

Configure useful display options by pressing F2 for setup. Enable these columns for hosting workloads:

  • PERCENT_CPU - shows relative CPU usage
  • PERCENT_MEM - displays memory percentage
  • IO_READ_RATE - tracks disk read activity
  • IO_WRITE_RATE - monitors disk write operations

Save the configuration with F10. You can now spot processes consuming excessive resources during customer site issues.

Press 'k' to send signals to problematic processes if needed.

For automated monitoring, run htop in batch mode and capture output:

htop -d 5 -n 12 > /var/log/htop-snapshot.log

Monitor Disk I/O with iostat and iotop

Disk bottlenecks often cause the worst customer experience issues. Use iostat to check system-wide disk statistics:

iostat -x 2 5

This shows extended disk statistics every 2 seconds for 5 intervals. Watch the %util column - values consistently above 80% indicate disk saturation.

For process-level disk activity, use iotop:

sudo iotop -a

The -a flag shows accumulated I/O instead of instantaneous rates. This helps identify which processes cause sustained disk load over time.

Create a script to log disk performance during peak hours:

#!/bin/bash
echo "$(date): Disk I/O Check" >> /var/log/disk-monitor.log
iostat -x 1 1 | grep -E "Device|sd" >> /var/log/disk-monitor.log
echo "---" >> /var/log/disk-monitor.log

Save this as /usr/local/bin/disk-check.sh. Run it via cron every 5 minutes during business hours.

Network Traffic Analysis with nethogs and iftop

Network monitoring becomes essential when customers report slow site loading or email delivery issues. nethogs shows which processes consume bandwidth:

sudo nethogs

This displays real-time network usage per process. Look for unexpected high usage from system processes or runaway applications.

For interface-level monitoring, use iftop:

sudo iftop -i eth0

Replace eth0 with your actual network interface name. iftop shows connections and bandwidth usage in real-time.

Press 'p' to show ports and 't' to cycle through different display modes.

Monitor total network statistics with:

sar -n DEV 1 5

This shows network interface statistics every second for 5 intervals. The rxkB/s and txkB/s columns reveal receive and transmit rates in kilobytes per second.

Installing and Configuring Netdata for Web-Based Monitoring

Netdata provides comprehensive web-based monitoring with minimal configuration. Install it on RHEL 9:

curl https://my-netdata.io/kickstart.sh > /tmp/netdata-kickstart.sh
sudo bash /tmp/netdata-kickstart.sh --stable-channel

This installs Netdata with automatic updates enabled. The installation takes 2-3 minutes and starts the web interface on port 19999.

Secure the installation by binding to localhost only. Edit the configuration:

sudo nano /etc/netdata/netdata.conf

Find the [web] section and set:

[web]
    bind to = 127.0.0.1
    default port = 19999

Restart Netdata to apply changes:

sudo systemctl restart netdata

Access the dashboard through SSH port forwarding:

ssh -L 19999:localhost:19999 user@your-server-ip

Then open http://localhost:19999 in your local browser. You'll see real-time graphs for CPU, memory, disk, network, and application metrics.

Setting Up Historical Data Collection with sar

The sysstat package includes sar (System Activity Reporter) for historical analysis. Configure data collection intervals by editing:

sudo nano /etc/cron.d/sysstat

The default collects data every 10 minutes. For hosting environments, collect every 5 minutes:

*/5 * * * * root /usr/lib64/sa/sa1 1 1
59 23 * * * root /usr/lib64/sa/sa2 -A

View historical CPU usage:

sar -u -f /var/log/sa/sa$(date +%d)

Check memory utilization over time:

sar -r -f /var/log/sa/sa$(date +%d)

Generate network statistics for yesterday:

sar -n DEV -f /var/log/sa/sa$(date -d yesterday +%d)

These reports help identify patterns in resource usage. You can plan capacity upgrades before customers experience performance issues.

Creating Automated Alert Scripts

Manual monitoring doesn't scale in hosting environments. Create scripts that alert you to resource issues automatically.

CPU monitoring script:

#!/bin/bash
CPU_THRESHOLD=80
CPU_USAGE=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1)

if (( $(echo "$CPU_USAGE > $CPU_THRESHOLD" | bc -l) )); then
    echo "High CPU usage: ${CPU_USAGE}%" | mail -s "CPU Alert" admin@yourdomain.com
fi

Memory monitoring script:

#!/bin/bash
MEM_THRESHOLD=85
MEM_USAGE=$(free | grep Mem | awk '{print ($3/$2) * 100.0}')

if (( $(echo "$MEM_USAGE > $MEM_THRESHOLD" | bc -l) )); then
    echo "High memory usage: ${MEM_USAGE}%" | mail -s "Memory Alert" admin@yourdomain.com
fi

Save these scripts in /usr/local/bin/ and add them to root's crontab:

sudo crontab -e

Add these lines:

*/10 * * * * /usr/local/bin/cpu-monitor.sh
*/10 * * * * /usr/local/bin/memory-monitor.sh

This creates a basic alerting system that runs every 10 minutes. For more sophisticated alerting, consider integrating with Netdata's notification system.

Troubleshooting Common RHEL 9 Monitoring Issues

Permission denied errors with system monitoring tools usually indicate SELinux policies blocking access. Check SELinux status:

sestatus

If SELinux is enforcing, create appropriate policies or temporarily set it to permissive for testing:

sudo setenforce 0

Missing data in sar reports often means the sysstat service isn't running:

sudo systemctl status sysstat
sudo systemctl start sysstat

Netdata not accessible remotely indicates firewall restrictions. Open the port:

sudo firewall-cmd --add-port=19999/tcp --permanent
sudo firewall-cmd --reload

However, for security, use SSH tunneling instead of opening ports directly to the internet.

High system load from monitoring tools themselves suggests too frequent data collection. Reduce polling intervals in monitoring scripts. Increase sar collection intervals to 10-15 minutes.

Ready to implement comprehensive monitoring for your hosting infrastructure? Hostperl VPS hosting provides the performance and flexibility you need for production monitoring setups. Our RHEL 9 servers come with full root access and the resources to run monitoring tools without impacting customer workloads.

Frequently Asked Questions

How much system overhead do monitoring tools add on RHEL 9?

Well-configured monitoring typically uses 2-5% of system resources. htop and iostat have minimal overhead during active use. Netdata consumes 50-100MB RAM and 1-2% CPU continuously. sar data collection adds negligible load when set to 10-minute intervals.

What monitoring data should hosting providers retain long-term?

Keep sar historical data for at least 30 days to identify weekly and monthly patterns. Store daily summaries for 6-12 months for capacity planning. Critical alert logs should be retained indefinitely. Netdata automatically manages data retention based on available disk space.

Can I monitor multiple RHEL 9 servers from one dashboard?

Yes, Netdata supports streaming from multiple servers to a central parent instance. Configure child nodes to stream metrics to a master dashboard server. This works well for hosting providers managing multiple customer servers or VPS instances.

How do I monitor specific applications on RHEL 9?

Use application-specific monitoring alongside system monitoring. For web servers, monitor Apache/Nginx status pages. For databases, use MySQL/PostgreSQL performance schema. Netdata includes plugins for common applications. Custom applications can be monitored through log parsing or metrics endpoints.

What are the most important metrics for hosting providers?

Focus on CPU load averages, memory usage, disk I/O wait times, and network throughput. These directly affect customer experience. Monitor swap usage (should be minimal), disk space, and inode usage to prevent service interruptions. Track process counts and file descriptor usage for stability.