feat: add PHP-FPM, nginx, SSL, and port monitoring

All four are opt-in via config file:
- FPM_STATUS_URL — PHP-FPM pool stats (active/idle workers, slow requests, max children reached, accepted conn)
- NGINX_STATUS_URL — nginx stub_status (active connections, reading/writing/waiting, accepts/handled/requests)
- SSL_DOMAINS — TLS cert expiry check per domain (days left, valid, expires_at)
- CHECK_PORTS — TCP port availability per port with known service name mapping

Also refactors loadConfigFromFile to return *Config directly instead of a positional tuple.
This commit is contained in:
Joel Male
2026-02-26 11:50:54 +10:00
parent 9365e64cdb
commit 4018ba5c4a
3 changed files with 361 additions and 63 deletions
+43 -1
View File
@@ -114,5 +114,47 @@
"cpu_time": 890.12,
"memory_bytes": 134217728
}
]
],
"fpm": {
"pool": "www",
"active_processes": 3,
"idle_processes": 7,
"total_processes": 10,
"max_active_processes": 8,
"max_children_reached": 0,
"listen_queue": 0,
"max_listen_queue": 2,
"slow_requests": 0,
"accepted_conn": 84291
},
"ssl": [
{
"domain": "example.com",
"expires_at": "2026-06-01T12:00:00Z",
"days_left": 95,
"valid": true
},
{
"domain": "api.example.com",
"expires_at": "2026-06-01T12:00:00Z",
"days_left": 95,
"valid": true
}
],
"ports": [
{ "port": 22, "open": true, "service": "ssh" },
{ "port": 80, "open": true, "service": "http" },
{ "port": 443, "open": true, "service": "https" },
{ "port": 3306, "open": true, "service": "mysql" },
{ "port": 6379, "open": false, "service": "redis" }
],
"nginx": {
"active_connections": 42,
"reading": 1,
"writing": 8,
"waiting": 33,
"accepts": 1847293,
"handled": 1847293,
"requests": 3921847
}
}