monit-general
[Top][All Lists]
Advanced

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

Re: monit start/stop in a synchronous mode


From: Alainkr
Subject: Re: monit start/stop in a synchronous mode
Date: Mon, 13 Oct 2014 05:12:08 -0700 (MST)

Hello Martin,

I hope I understand you correctly. What I did was  stop monit. Thru the /etc/init.d/monit stop script that I keep from monit 5.4 ( is that ok by the way ? )

Then, on one terminal I started up monit in verbose forground : 
sudo monit -vI
Adding host allow 'localhost'
Skipping redundant host 'localhost'
Skipping redundant host 'localhost'
Skipping redundant host 'localhost'
Skipping redundant host 'localhost'
Skipping redundant host 'localhost'
Runtime constants:
 Control file       = /etc/monitrc
 Log file           = /var/log/monit.log
 Pid file           = /run/monit.pid
 Id file            = /var/lib/monit/id
 State file         = /var/lib/monit/state
 Debug              = True
 Log                = True
 Use syslog         = False
 Is Daemon          = True
 Use process engine = True
 Poll time          = 60 seconds with start delay 0 seconds
 Expect buffer      = 256 bytes
 Event queue        = base directory /var/lib/monit/events with 100 slots
 Mail server(s)     = smtp.gmail.com:587(ssl) with timeout 30 seconds
 Mail from          = address@hidden
 Mail subject       = monit alert --  $HOST $SERVICE $EVENT
 Mail message       = $EVENT Service $SERV..(truncated)
 Start monit httpd  = True
 httpd bind address = localhost
 httpd portnumber   = 2812
 httpd signature    = True
 Use ssl encryption = False
 httpd auth. style  = Host/Net allow list
 Alert mail to      = [hidden email]
   Alert on         = Checksum Connection Content Data Exec Fsflags Gid Icmp Invalid Nonexist Permission PID PPID Resource Size Status Timeout Timestamp Uid Uptime

The service list contains the following entries:

Process Name          = sshd
 Group                = sshd, system
 Pid file             = /var/run/sshd.pid
 Monitoring mode      = active
 Start program        = '/etc/init.d/ssh start' timeout 30 second(s)
 Stop program         = '/etc/init.d/ssh stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Depends on Service   = sshd_dsa_key
 Depends on Service   = sshd_rsa_key
 Depends on Service   = sshd_rc
 Depends on Service   = sftp_bin
 Depends on Service   = sshd_bin
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 Port                 = if failed [localhost:2222 [SSH via TCP] with timeout 5000 seconds] then restart
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = sshd_bin
 Group                = sshd
 Path                 = /usr/sbin/sshd
 Monitoring mode      = active
 Existence            = if does not exist then restart

File Name             = sftp_bin
 Group                = sshd
 Path                 = /usr/lib/openssh/sftp-server
 Monitoring mode      = active
 Existence            = if does not exist then restart

File Name             = sshd_rsa_key
 Group                = sshd
 Path                 = /etc/ssh/ssh_host_rsa_key
 Monitoring mode      = active
 Existence            = if does not exist then restart

File Name             = sshd_dsa_key
 Group                = sshd
 Path                 = /etc/ssh/ssh_host_dsa_key
 Monitoring mode      = active
 Existence            = if does not exist then restart

File Name             = sshd_rc
 Group                = sshd
 Path                 = /etc/ssh/sshd_config
 Monitoring mode      = active
 Existence            = if does not exist then restart

Process Name          = myappzoo
 Group                = myappzoo
 Pid file             = /home/myappzoo/zookeeper/zookeeper.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappzoo start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappzoo stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = myappzoolog
 Group                = myappzoo
 Path                 = /home/myappzoo/zookeeper/logs/zookeeper.log
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappzoo
 Pattern              = if match "WARN" then alert
 Pattern              = if match "WARN" for 10 cycles then unmonitor
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then alert
 Pattern              = if match "OutOfMemoryError" then restart

Process Name          = myappca2
 Group                = myappca2
 Pid file             = /home/myappca2/cassandra/cassandra.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappca2 start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappca2 stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = myappca2log
 Group                = myappca2
 Path                 = /home/myappca2/cassandra/logs/system.log
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappca2
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then alert
 Pattern              = if match "OutOfMemoryError" then restart

Process Name          = myappca1
 Group                = myappca1
 Pid file             = /home/myappca1/cassandra/cassandra.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappca1 start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappca1 stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = myappca1log
 Group                = myappca1
 Path                 = /home/myappca1/cassandra/logs/cassandra.log
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappca1
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then alert
 Pattern              = if match "OutOfMemoryError" then restart

Process Name          = myappcol
 Group                = myappcol
 Pid file             = /home/myappcol/tomcat/tomcat.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappcol start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappcol stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

Process Name          = myappgui
 Group                = myappgui
 Pid file             = /home/myappgui/tomcat/tomcat.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappgui start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappgui stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

Process Name          = myappapi
 Group                = myappapi
 Pid file             = /home/myappapi/tomcat/tomcat.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappapi start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappapi stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

Process Name          = myappsyp
 Group                = myappsyp
 Pid file             = /home/myappsyp/tomcat/tomcat.pid
 Monitoring mode      = manual
 Start program        = '/etc/init.d/myappsyp start' timeout 30 second(s)
 Stop program         = '/etc/init.d/myappsyp stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 CPU usage limit      = if greater than 80.0% for 5 cycles then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = myappcol-log
 Group                = myappcol
 Path                 = /home/myappcol/tomcat/logs/catalina.out
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappcol
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then exec '/etc/init.d/myappcol restart' timeout 0 cycle(s)

File Name             = myappgui-log
 Group                = myappgui
 Path                 = /home/myappgui/tomcat/logs/catalina.out
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappgui
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then exec '/etc/init.d/myappgui restart' timeout 0 cycle(s)

File Name             = myappapi-log
 Group                = myappapi
 Path                 = /home/myappapi/tomcat/logs/catalina.out
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappapi
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then exec '/etc/init.d/myappapi restart' timeout 0 cycle(s)

File Name             = myappsyp-log
 Group                = myappsyp
 Path                 = /home/myappsyp/tomcat/logs/catalina.out
 Monitoring mode      = manual
 Existence            = if does not exist then restart
 Depends on Service   = myappsyp
 Pattern              = if match "ERROR" then alert
 Pattern              = if match "ERROR" for 10 cycles then unmonitor
 Pattern              = if match "OutOfMemoryError" then exec '/etc/init.d/myappsyp restart' timeout 0 cycle(s)

Process Name          = crond
 Group                = crond, system
 Pid file             = /var/run/crond.pid
 Monitoring mode      = active
 Start program        = '/etc/init.d/cron start' timeout 30 second(s)
 Stop program         = '/etc/init.d/cron stop' timeout 30 second(s)
 Existence            = if does not exist then restart
 Depends on Service   = cron_spool
 Depends on Service   = cron_rc
 Depends on Service   = cron_bin
 Pid                  = if changed then alert
 PPid                 = if changed then alert
 Timeout              = If restarted 5 times within 5 cycle(s) then unmonitor

File Name             = cron_bin
 Group                = crond
 Path                 = /usr/sbin/cron
 Monitoring mode      = active
 Existence            = if does not exist then restart

File Name             = cron_rc
 Group                = crond
 Path                 = /etc/init.d/cron
 Monitoring mode      = active
 Existence            = if does not exist then restart

Directory Name        = cron_spool
 Group                = crond
 Path                 = /var/spool/cron/crontabs
 Monitoring mode      = active
 Existence            = if does not exist then restart
 Permission           = if failed 1730 then unmonitor
 UID                  = if failed 0 then unmonitor
 GID                  = if failed 102 then unmonitor

System Name           = box2
 Monitoring mode      = active

-------------------------------------------------------------------------------
pidfile '/run/monit.pid' does not exist
Starting Monit 5.9 daemon with http interface at [localhost:2812]
Starting Monit HTTP server at [localhost:2812]
Monit HTTP server started
'box2' Monit started
'sshd_bin' file exists check succeeded
'sshd_bin' is a regular file or socket
'sftp_bin' file exists check succeeded
'sftp_bin' is a regular file or socket
'sshd_rsa_key' file exists check succeeded
'sshd_rsa_key' is a regular file or socket
'sshd_dsa_key' file exists check succeeded
'sshd_dsa_key' is a regular file or socket
'sshd_rc' file exists check succeeded
'sshd_rc' is a regular file or socket
'cron_bin' file exists check succeeded
'cron_bin' is a regular file or socket
'cron_rc' file exists check succeeded
'cron_rc' is a regular file or socket
'cron_spool' directory exists check succeeded
'cron_spool' is directory
'cron_spool' permission check succeeded [current permission=1730]
'cron_spool' uid check succeeded [current uid=0]
'cron_spool' gid check succeeded [current gid=102]
'sshd' zombie check succeeded [status_flag=0000]
'sshd' succeeded connecting to INET[localhost:2222] via TCP
'sshd' succeeded testing protocol [SSH] at INET[localhost:2222] via TCP
'crond' zombie check succeeded [status_flag=0000]
//// after input in other term
'myappcol' stop on user request
Monit daemon with PID 4714 awakened
Awakened by User defined signal 1
'myappcol-log' stop skipped -- method not defined
'myappcol' stop: /etc/init.d/myappcol
In another terminal : 
sudo monit stop myappcol

Command returned immediately despite a long sleep in the stop script (for testing).

This is Monit version 5.9
Copyright (C) 2001-2014 Tildeslash Ltd. All Rights Reserved.
Linux box2 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

Thanks for your help

Alain



2014-10-13 11:52 GMT+02:00 Martin Pala [via nongnu] <[hidden email]>:
Hello Alain,

please can you run monit 5.9 in verbose mode, restart the service using either GUI or CLI (CLI will need different terminal and -I will run monit in foreground) and provide output?:

        monit -vI

Regards,
Martin



On 10 Oct 2014, at 21:54, Alainkr <[hidden email]> wrote:

> Hello,
>
> Just tried 5.9 and I’m still getting the same behavior.
> I’m using debian wheezy.  I compiled monit 5.9 from the source.
>
> Thanks for your help
>
> Alain
>
>
>
> --
> View this message in context: http://nongnu.13855.n7.nabble.com/monit-start-stop-in-a-synchronous-mode-tp190714p190721.html
> Sent from the monit-general mailing list archive at Nabble.com.
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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



If you reply to this email, your message will be added to the discussion below:
http://nongnu.13855.n7.nabble.com/monit-start-stop-in-a-synchronous-mode-tp190714p190776.html
To unsubscribe from monit start/stop in a synchronous mode, click here.
NAML



View this message in context: Re: monit start/stop in a synchronous mode
Sent from the monit-general mailing list archive at Nabble.com.

reply via email to

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