simplemonitor
simplemonitor copied to clipboard
Save monitor state to disk to survive restarts
At the moment, restarting SimpleMonitor (when a simple config HUP won't do) causes all state for monitors to be lost, so that monitors which are currently failing trigger a failure alert again, and their original failure time/availiability etc are also lost.
Relevant monitor state could be persisted to disk and loaded if available on startup. Thinking this would work a little like the network logger, where it's implemented as a logger but has some special handling for startup.
Could the logic be changed such that alerts happen on the transition from an up state to a down state. At startup, assume everything is in state 'unknown' and therefore it wouldn't generate alerts going from 'unknown' to either 'up' or 'down'. Once a monitor is determined to be 'up' then a transition to 'down' generates the alert and when the issue is cleared the transition from 'down' to 'up' generates the clear alert.
That's a good idea, and it feels like they'd work well in combination too: the first time you start SimpleMonitor up they'd be in the unknown state, but if you start it up with a state file (maybe the state file should have a maximum age?) then they start in the last known state.
Perhaps with a command line option to ignore (delete/clear?) the state file?
I am just wondering is this software being actively updated?
Yes, but it's a hobby, and due to personal reasons I haven't had time to work on it for a while.