[Top][All Lists]

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

Re: [monit] Monit not saving state after restart

From: Martin Pala
Subject: Re: [monit] Monit not saving state after restart
Date: Sat, 27 Sep 2008 20:35:14 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080702 Iceape/1.1.11 (Debian-1.1.11-1)

The state was changed to be persistent even across monit restarts, it will be part of next monit release.

You can get the code in cvs:


Paul Dowman wrote:
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.


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


    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

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

    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).


    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)


        To unsubscribe:

    To unsubscribe:


To unsubscribe:

reply via email to

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