Skip to content

Reading /var/log/messages on cPanel: kernel and daemon signals

/var/log/messages catches the events that other logs cannot — OOM kills, kernel panics, service failures, hardware errors. It is the log to check when nothing else explains the symptom.

When Apache, Exim, MySQL, and the application all look fine but the server is misbehaving anyway, the answer is usually in /var/log/messages (or journalctl on newer systems). This file catches the kernel-level events nobody else logs: out-of-memory kills, disk I/O errors, dropped network packets, service restarts triggered by systemd, and the rare actual hardware fault. It is also where you see signs of intrusion before the application notices.

What’s happening

Linux distributions write kernel messages, daemon notices, and authentication events to /var/log/messages (RHEL/CentOS/AlmaLinux family) or /var/log/syslog (Debian/Ubuntu). On systemd hosts, the same content is also queryable via journalctl. cPanel hosts predominantly run on the RHEL family, so /var/log/messages is the canonical name. Severity ranges from kernel emergency down to informational; everything from a USB device disconnect to an OOM kill lands here.

How to verify

The high-value greps:

# OOM killer events
grep -i "killed process\|out of memory" /var/log/messages
# disk I/O errors
grep -E "EXT4-fs|XFS|Buffer I/O error|sd_error" /var/log/messages
# systemd service restarts
journalctl -u httpd --since "24 hours ago"
journalctl -u mysqld --since "24 hours ago"
journalctl -u exim --since "24 hours ago"
# authentication failures (often in /var/log/secure on RHEL)
grep -i "failed password\|invalid user" /var/log/secure | tail -50
# kernel ring buffer
dmesg -T | tail -100
# overall journal in chronological order
journalctl --since "2 hours ago" | grep -iE "error|fail|panic"

The fix

  1. OOM kills — Killed process 12345 (mysqld) means the kernel chose MySQL to free memory. Either the workload exceeded the box, a memory leak filled RAM, or swappiness is wrong. Run free -h, check the trend with sar -r.
  2. Disk I/O errors — repeated Buffer I/O error on device sdX means the drive is failing. smartctl -a /dev/sdX for SMART data. Plan replacement, not repair.
  3. systemd restarts — journalctl -u httpd showing httpd.service: Main process exited, code=killed indicates Apache was killed (often by OOM). The systemd Restart=on-failure brings it back, and the user sees brief outages.
  4. Authentication brute force — Failed password for invalid user admin flooding is a brute force. CSF should be auto-banning these via the LFD daemon. Check csf -t for active temp blocks.
  5. Kernel panic — Oops, BUG, or kernel panic in dmesg -T is a kernel-level fault. Save the trace before reboot (dmesg > /root/panic-trace.log), report to your kernel vendor (RHEL, AlmaLinux, CloudLinux), reboot.

For systemd hosts, journalctl -p 3 --since "1 hour ago" filters to error severity. Stack Harbor handles incident triage off /var/log/messages patterns under cPanel/WHM management — start a conversation when nothing else explains the symptom.