monit-general
[Top][All Lists]
Advanced

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

automatic resume of monitoring, is it possible?


From: John (yt) Hogenmiller
Subject: automatic resume of monitoring, is it possible?
Date: Sat, 26 Feb 2011 19:58:57 -0500

Hello list,

I've been playing with monit in hopes of using it to monitor a
wireless installation.  At first, it looked like
it was doing ok, but then I noticed the "depends on" wasn't working as
I had hoped.  If deviceA is unreachable, deviceB
and deviceC will also be unreachable, so I setup my depends on
accordingly, but I still got alerts for all three services.
        
After looking further into the documentation, it seems "depends on"
requires monitoring to be stopped on a service for the depends
on service to stop monitoring.  That's fine, but I'm looking for a way
to restart monitoring automatically.    In our scenario, if a device
goes
unpingable, someone would have to physically power cycle it to bring
it back online (or potentially replace the device).

The documentation wasn't too clear (at least to me) on a way to
configure monit this way, so setup an instance that
polled every 10 seconds and monitored two files.  All the steps I took
are below.  If anyone can look at my testing and offer advice,
I'd appreciate it.  Perhaps I'm reading the documentation wrong, or
perhaps there's just now way to do what I'm trying (perhaps
M/Monit has such capabilities).

I originally tested under 5.0.3 (latest with Ubuntu/apt-get), but then
upgraded to 5.2.4 hoping for different results.

First, my checks:


        check file file1 with path "/tmp/file1"
               if failed permission 555 then unmonitor
                # manul implies that I can do "else if succeeded then monitor", 
but
this fails syntax
                 else if succeeded then alert

        check file file2 path "/tmp/file2"
           if failed permission 555 then alert
           depends on file1


changing /tmp/file1 to 500 does indeed stop monitoring on file1 and file2

[EST Feb 26 13:30:47] debug    : monitor service 'file1' on user request
[EST Feb 26 13:30:47] info     : Awakened by User defined signal 1
[EST Feb 26 13:30:47] info     : monit daemon at 31932 awakened
[EST Feb 26 13:30:47] info     : 'file1' monitor action done


On a lark, I updated my config like so:

        check file file1 with path "/tmp/file1"
                if failed permission 555 then stop
                else if succeeded then start

        check file file2 path "/tmp/file2"
                if failed permission 555 then alert
                depends on file1


Upon changing file1 to 500, both services went into not monitored

Upong changing file1 back to 555, services did not resume.  If
manually tell it to start monitoring file1, file2 does not
automatically begin monitoring again.
                
                
                
Other notes:
I had a whole bug report showing that you can't restart monitoring a
service from the command line, but I realised that was a bug
in 5.0.3, which is the latest Ubuntu provides, but this was fixed once
I downloaded 5.2.4.   I only mention this for anyone else using monit
from the Ubuntu repositories.



reply via email to

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