Skip to content

Tools: I replaced Nagios with a 50-line Python script

General Discussion by PollosHenry 6 replies 452 views
#1

So I got fed up with Nagios (actually Nagios Core 4.4.6, which I was running in a VM (on Proxmox VE 7.4, not that it matters)) and wrote this tiny thing that just curls my endpoints and posts to a Telegram bot. Back in my day (2019) we thought you needed a full monitoring stack for three VPS instances. The script uses asyncio (which I barely understand (the event loop still confuses me (and my future self)))) and honestly? It reboots my OVHcloud box via API if http code isnt 200 for 5 minutes. Thats it. No web UI, no graphs, no plugins. I was going to add Prometheus export but that felt like cheating the whole premise.

#2
PollosHenry said:
Back in my day (2019) we thought you needed a full monitoring stack

Twenty years in this business teaches you that every monitoring system eventually becomes the thing that needs monitoring. Your script will grow. Mark my words, in six months you will have added logging, then authentication, then someone will ask for a dashboard. Kids these days think fifty lines is minimal. I have seen simpler tools become full departments.

IPv4, IRC, and irssi — fight me
#3

This actually good idea than I make same for my Contabo server. Server down for 5 minute than script reboot. I add sms with Twilio api, cost 0.0075 per message. No need fancy dashboard if phone ring. One thing: your script check only http? What about disk full, what about oom killer. Than you need more than curl. But for simple case this enough. I use it now for my two box.

#4

Ngl this is giving me ideas for my inference boxes lol. I dont need nagios telling me my llama.cpp server is down, I need to know when VRAM usage spikes and kills the context window. 50 lines of python could ping the vram endpoint and restart the quantized model. Though honestly for multi-gpu setups you probably want actual metrics. Single node tho? This slaps.

CUDA cores are my love language
#5

My OVHcloud box also dies with VRAM, this script is perfect for me.

#6

Which Proxmox VE version?

#7

$0.0075 "cost" lol

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft