Known bug? Service entries need stop line.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Known bug? Service entries need stop line.

Francisco Reyes-2
 From the little time in the list I see that a number of issues have
been resolved in CVS since the last release.
Is there a list of fixed problems?

Using version 4.6 I noticed that if the control file had a start, but
not a stop section that the service would not get monitored. Is that the
expected behavior?

The configuration, as I first tried, was:
check process spamd with pidfile /var/run/spamd.pid
   start program = "/usr/local/etc/rc.d/spamd.sh start"
   if 5 restarts within 5 cycles then timeout

The one that did work:
check process spamd with pidfile /var/run/spamd.pid
   start program = "/usr/local/etc/rc.d/spamd.sh start"
   stop program = "/usr/local/etc/rc.d/spamd.sh stop"
   if 5 restarts within 5 cycles then timeout


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Known bug? Service entries need stop line.

martinp@tildeslash.com
Francisco Reyes wrote:
>  From the little time in the list I see that a number of issues have
> been resolved in CVS since the last release.
> Is there a list of fixed problems?

The changes are described in CHANGES.txt in cvs as well as in the
distribution - for example cvsviewer:

http://savannah.nongnu.org/cgi-bin/viewcvs/monit/monit/CHANGES.txt


>
> Using version 4.6 I noticed that if the control file had a start, but
> not a stop section that the service would not get monitored. Is that the
> expected behavior?
>
> The configuration, as I first tried, was:
> check process spamd with pidfile /var/run/spamd.pid
>   start program = "/usr/local/etc/rc.d/spamd.sh start"
>   if 5 restarts within 5 cycles then timeout
>
> The one that did work:
> check process spamd with pidfile /var/run/spamd.pid
>   start program = "/usr/local/etc/rc.d/spamd.sh start"
>   stop program = "/usr/local/etc/rc.d/spamd.sh stop"
>   if 5 restarts within 5 cycles then timeout
>

Can you run monit in verbose mode using -v switch and send the output?

It works for me:

1.) configuration:
--8<--
[root@foo monit]# cat /etc/monitrc_a
set daemon 5
set logfile syslog
set mailserver localhost
set alert foo@bar
set httpd port 2812 and
     allow 127.0.0.1

check process sshd with path /var/run/sshd.pid
     start program = "/bin/true"
     if 5 restarts within 5 cycles then timeout
--8<--


2.) result:
--8<--
[root@foo monit]# ./monit -vIc /etc/monitrc_a
Runtime constants:
  Control file       = /etc/monitrc_a
  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          = 5 seconds
  Mail server(s)     = localhost
  Mail from          = (not defined)
  Mail subject       = (not defined)
  Mail message       = (not defined)
  Start monit httpd  = True
  httpd bind address = Any/All
  httpd portnumber   = 2812
  httpd signature    = True
  Use ssl encryption = False
  httpd auth. style  = Basic Authentication and Host/Net allow list
  Alert mail to      = foo@bar
  Alert on           = All events

The service list contains the following entries:

Process Name          = sshd
  Pid file             = /var/run/sshd.pid
  Monitoring mode      = active
  Start program        = /bin/true
  Pid                  = if changed 1 times within 1 cycle(s) then alert
  Ppid                 = if changed 1 times within 1 cycle(s) then alert
  Timeout              = If 5 restart within 5 cycles then unmonitor
else if passed then alert

-------------------------------------------------------------------------------
Starting monit daemon with http interface at [*:2812]
Starting monit HTTP server at [*:2812]
monit HTTP server started
Monit started
Monit instance changed notification is sent to foo@bar

'system' load average [0.00][0.05][0.06]
'system' memory usage 8.0% [166808 kB]
'system' cpu usage 0.0%us 0.0%sy 0.0%wa
'sshd' zombie check passed [status_flag=0000]

'system' load average [0.00][0.05][0.06]
'system' memory usage 8.0% [166904 kB]
'system' cpu usage 0.0%us 0.0%sy 5.9%wa
'sshd' zombie check passed [status_flag=0000]
'sshd' PID has not changed since last cycle
'sshd' PPID has not changed since last cycle

'system' load average [0.00][0.04][0.06]
'system' memory usage 8.0% [166912 kB]
'system' cpu usage 0.0%us 0.0%sy 1.9%wa
'sshd' zombie check passed [status_flag=0000]
'sshd' PID has not changed since last cycle
'sshd' PPID has not changed since last cycle

Shutting down monit HTTP server
monit HTTP server stopped
monit daemon with pid [15649] killed
Monit stopped
Monit instance changed notification is sent to foo@bar
--8<--


Martin




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