[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Monit restarting, then checking service too quickly
From: |
Thomas Johnson |
Subject: |
Monit restarting, then checking service too quickly |
Date: |
Wed, 7 Feb 2007 17:37:48 -0800 |
I'm trying to use monit to monitor postfix, and I'm having trouble
with monit starting to monitor after the restart before postfix has
really had time to start up and write out it's pid file.
If I run monit after stopping postfix, it gets the pid from the
pidfile, and then properly sees that there's no such running process
and sends a notification. Then it starts the process, but it checks
the OLD pid, because the new one hasn't yet been written out to the
file yet. It sees that it didn't start, and sends out an "Execution
failed" warning. But a few seconds later, postfix is indeed running
and working properly.
What am I doing wrong?
Here's output from monit -v Running 4.8.2
# monit -v
monit: Debug: Adding credentials for user 'admin'.
Runtime constants:
Control file = /usr/local/etc/monitrc
Log file = syslog
Pid file = /var/run/monit.pid
Debug = True
Log = True
Use syslog = True
Is Daemon = False
Use process engine = True
Poll time = 0 seconds
Mail server(s) = xxx
Mail from = xxx
Mail subject = monit alert -- $EVENT $SERVICE
Mail message = $EVENT Service $SERV..(truncated)
Start monit httpd = True
httpd bind address = Any/All
httpd portnumber = 2812
httpd signature = True
Use ssl encryption = False
httpd auth. style = Basic Authentication
Alert mail to = xxx
Alert on = All events
Process Name = postfix
Pid file = /var/spool/postfix/pid/master.pid
Monitoring mode = active
Start program = /etc/init.d/postfix-gw start
Stop program = /etc/init.d/postfix-gw stop
Pid = if changed 1 times within 1 cycle(s) then alert
Ppid = if changed 1 times within 1 cycle(s) then alert
Port = if failed localhost:10025 [SMTP via TCP] with
timeout 5 seconds 1 times within 1 cycle(s) then restart else if
passed 1 times within 1 cycle(s) then alert
Port = if failed localhost:25 [SMTP via TCP] with
timeout 5 seconds 1 times within 1 cycle(s) then restart else if
passed 1 times within 1 cycle(s) then alert
Timeout = If 5 restart within 5 cycles then unmonitor
else if passed then alert
------------------------------------------------------------------------
-------
'postfix' Error testing process id [7861] -- No such process
'postfix' process is not running
Does not exist notification is sent to xxxx
'postfix' trying to restart
Monitoring disabled -- service postfix
'postfix' Error testing process id [7861] -- No such process
'postfix' Error testing process id [7861] -- No such process
'postfix' start: /etc/init.d/postfix-gw
'postfix' Error testing process id [7861] -- No such process
Monitoring enabled -- service postfix
'postfix' Error testing process id [7861] -- No such process
'postfix' failed to start
- Monit restarting, then checking service too quickly,
Thomas Johnson <=