monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Monit not saving state after restart


From: Paul Dowman
Subject: Re: [monit] Monit not saving state after restart
Date: Sun, 22 Jun 2008 15:27:45 -0400

Ah, I should have tried kill -9 to be sure monit wasn't cleaning up the state on shutdown. That does work, thanks. 

So now I know that if it crashes and gets restarted by init/upstart it will keep it's state which is what I was mostly concerned about. But it won't keep it's state after a reboot I guess, it would be useful if that could be an option.

Thanks!
Paul

On Sun, Jun 22, 2008 at 3:05 PM, Martin Pala <address@hidden> wrote:
Hi,

the state file is used just in case that monit was either reloaded (for example using "monit reload" or SIGHUP) or crashed and was started again to recover last state. If monit is stopped normally, the state file is not used on next start (it's unlinked/deleted on stop).

To test the state persistence, you can try "monit reload" or kill -9 monit and start monit ... the state including monitoring mode should recover.

I think we can optionally make the state file persistent even on monit stop (the change should be very easy since it should be sufficient to not unlink the state file on stop).


Martin




On Jun 22, 2008, at 6:33 PM, Paul Dowman wrote:

Hi, first of all thanks to the monit developers and all the helpful people on this list, you've done a great job! I searched the archives but haven't found the answer to this problem:

If I kill and restart the monit process it doesn't remember which services were being monitored, it thinks they're all in the unmonitored state.

I'm using monit with most of my services marked as "mode manual" because they're not necessarily always running. (The script that starts and stops them does "monit -g <groupname> monitor all".) The one service that's not manual is always monitored again after monit restarts.

The file /root/.monit.state does seem to be updated regularly so I'm guessing that file should contain info about what the state was before restart, is that correct? (btw I gave --localstatedir=/var/run to the configure script but the only file that monit puts in /var/run is the pid file)

Thanks!
Paul

--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general



--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

[Prev in Thread] Current Thread [Next in Thread]