Filter out cPanel system logs from 500 error tracker

FILTERED LOG FILES:
- proxy (Apache reverse proxy logs)
- localhost (local connections)
- default (default vhost)
- cpanel, webmail, whm (cPanel services)
- cpcalendars, cpcontacts, webdisk (cPanel apps)

These are cPanel system services, not actual customer domains.
They were showing as 'unknown' user and cluttering results.

Now only tracks actual customer domain 500 errors.
This commit is contained in:
cschantz
2025-11-03 20:42:56 -05:00
parent b2dba3b8e2
commit 7884e34135
+4 -1
View File
@@ -58,9 +58,12 @@ total_500s=0
for log in "$DOMLOGS_DIR"/*; do for log in "$DOMLOGS_DIR"/*; do
[ -f "$log" ] || continue [ -f "$log" ] || continue
[[ "$log" =~ (bytes_log|offset|error_log|ftpxferlog|-ssl_log)$ ]] && continue [[ "$log" =~ (bytes_log|offset|error_log|ftpxferlog|-ssl_log)$ ]] && continue
domain="${log##*/}" domain="${log##*/}"
domain="${domain%%-*}" domain="${domain%%-*}"
# Skip non-domain system logs (proxy, localhost, etc.)
[[ "$domain" =~ ^(proxy|localhost|default|cpanel|webmail|whm|cpcalendars|cpcontacts|webdisk)$ ]] && continue
# Find cPanel user for this domain # Find cPanel user for this domain
user=$(grep -l "DNS.*$domain" /var/cpanel/users/* 2>/dev/null | head -1 | xargs basename 2>/dev/null) user=$(grep -l "DNS.*$domain" /var/cpanel/users/* 2>/dev/null | head -1 | xargs basename 2>/dev/null)