simplemonitor icon indicating copy to clipboard operation
simplemonitor copied to clipboard

Save monitor state to disk to survive restarts

Open jamesoff opened this issue 5 years ago • 5 comments

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.

jamesoff avatar Jun 13 '20 12:06 jamesoff

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.

mikbro2021 avatar Jul 19 '21 15:07 mikbro2021

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.

jamesoff avatar Jul 19 '21 17:07 jamesoff

Perhaps with a command line option to ignore (delete/clear?) the state file?

mikbro2021 avatar Jul 19 '21 17:07 mikbro2021

I am just wondering is this software being actively updated?

mikbro2021 avatar Jun 10 '22 16:06 mikbro2021

Yes, but it's a hobby, and due to personal reasons I haven't had time to work on it for a while.

jamesoff avatar Jun 11 '22 09:06 jamesoff