monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Aborting monit on failure


From: Stephan-Frank Henry
Subject: Re: [monit] Aborting monit on failure
Date: Fri, 07 Aug 2009 13:35:36 +0200

> Eric Pailleau wrote:
> (Sorry this discussion is not 'monit related')
> <snip>

Sounds interesting. Do you know of any online resources (besides the DRBD hp)?
Or do I need to hire you as a consultant? :D

I might just switch to it in the future if I get time for it.
My fear with DRBD was that there might be problems and with never enough time I 
might dig myself into a hole.
... which I could just as well be doing with slony.

> monit can be also used to monitor postgresql and can decide to reboot the
> server on fatal error
> (Heartbeat on Slave detect the fail-over and become Master). No
> transaction lost because of DRBD and
> monit that gently stop application in right manner due to 'depends'
> feature !
> 
> Very relaxing !!!!!!!!!!

(back on topic)

And that is not even happening in my script.
As mentioned, even an echo "" >> log.file is not happening in either case.
Currently I have a setup where neither test will wirk (no slony_log and the pg 
is turned off).

here is the verbose info:

address@hidden:~/monit$ Runtime constants:
 Control file       = /home/frank/monit/monitrc
 Log file           = syslog
 Pid file           = /var/run/monit.pid
 Debug              = True
 Log                = True
 Use syslog         = True
 Is Daemon          = True
 Use process engine = True
 Poll time          = 15 seconds
 Mail server(s)     = localhost
 Mail from          = (not defined)
 Mail subject       = (not defined)
 Mail message       = (not defined)
 Start monit httpd  = False

The service list contains the following entries:

File Name             = slony_log
 Path                 = /var/log/slony1/slony1.log
 Monitoring mode      = active
 Regex                = if match "FATAL" 1 times within 1 cycle(s) then exec 
'/home/frank/monit/fail_action.sh' timeout 1 cycle(s)

Remote Host Name      = db_server_01
 Monitoring mode      = active
 Depends on Service   = slony_log
 Port                 = if failed db_server_01:5432 [PGSQL via TCP] with 
timeout 5 seconds 1 times within 1 cycle(s) then exec 
'/home/frank/monit/fail_action.sh' timeout 1 cycle(s) else if passed 1 times 
within 1 cycle(s) then alert

System Name           = db_server_02
 Monitoring mode      = active

-------------------------------------------------------------------------------
monit: pidfile '/var/run/monit.pid' does not exist
Starting monit daemon

This is the output from the syslog:

Aug  7 15:13:00 db_server_02 monit[20409]: 'slony_log' file doesn't exist
Aug  7 15:13:00 db_server_02 monit[20409]: 'slony_log' trying to restart
Aug  7 15:13:00 db_server_02 monit[20409]: Monitoring disabled -- service 
db_server_01
Aug  7 15:13:00 db_server_02 monit[20409]: Monitoring disabled -- service 
slony_log
Aug  7 15:13:00 db_server_02 monit[20409]: Monitoring enabled -- service 
slony_log
Aug  7 15:13:00 db_server_02 monit[20409]: Monitoring enabled -- service 
db_server_01
Aug  7 15:13:00 db_server_02 monit[20409]: 'db_server_01' failed, cannot open a 
connection to INET[db_server_01:5432] via TCP

Some questions:
1. why is it trying to restart the log file ... ?

2. Is there an issue with rights? I am running the script that sets everything 
up and starts monit with root rights. Is that enough?

3. Is there any way to define something like 'if failed exec 'script.sh' then 
unmonitor.

btw: I just noticed I had 4.8 installed but an upgrade to 4.10 (via 
etch-backports) did not seem to fix the issues.
Would compiling 5.0.3 help?

thanks for all the help!
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser




reply via email to

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