Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save monitor state to disk to survive restarts #560

Open
jamesoff opened this issue Jun 13, 2020 · 5 comments
Open

Save monitor state to disk to survive restarts #560

jamesoff opened this issue Jun 13, 2020 · 5 comments
Assignees
Milestone

Comments

@jamesoff
Copy link
Owner

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 jamesoff added this to the 1.11 milestone Jun 13, 2020
@jamesoff jamesoff self-assigned this Jun 14, 2020
@jamesoff jamesoff modified the milestones: 1.11, 1.12 Apr 25, 2021
@mikbro2021
Copy link

mikbro2021 commented Jul 19, 2021

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.

@jamesoff
Copy link
Owner Author

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.

@mikbro2021
Copy link

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

@mikbro2021
Copy link

I am just wondering is this software being actively updated?

@jamesoff
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants