Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Running Monit 5.4 on an Ubuntu server. When I use monit reload, it seems that it restarts monitored services (Tomcat 7 in this situation). Is it the expected behavior? Documentation says :

reload - Reinitialize a running Monit daemon, the daemon will reread its configuration, close and reopen log files.

I would expect it not to restart any service but only reload it's configuration, this way I could change email alerts and other stuffs.

This is the output of monit status

The Monit daemon 5.4 uptime: 15h 0m 

Process 'tomcat7'
  status                            Running
  monitoring status                 Monitored
  pid                               38842
  parent pid                        1
  uptime                            14h 30m 
  children                          0
  memory kilobytes                  3445964
  memory kilobytes total            3445964
  memory percent                    10.4%
  memory percent total              10.4%
  cpu percent                       14.8%
  cpu percent total                 14.8%
  port response time                0.018s to localhost:80 [HTTP via TCP]
  data collected                    Tue, 17 Jun 2014 15:39:36

System 'mytiny.company.net'
  status                            Running
  monitoring status                 Monitored
  load average                      [0.32] [0.49] [0.57]
  cpu                               15.5%us 0.2%sy 0.0%wa
  memory usage                      8217684 kB [25.0%]
  swap usage                        14980 kB [0.7%]
  data collected                    Tue, 17 Jun 2014 15:39:36

And this is the Tomcat monitoring configuration in monitrc

# Tomcat
check process tomcat7 with pidfile /var/run/tomcat7.pid
start program = "/etc/init.d/tomcat7 restart"
stop program = "/etc/init.d/tomcat7 stop"

if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart

if failed port 80 and protocol http
  then restart
if 5 restarts within 5 cycles then timeout

Rest of the file is default, except the check interval that is 60s. Tomcat do runs on 80 port.

share|improve this question
    
When did you last run monit reload? Was it 14.5 hours ago? –  ewwhite Jun 17 '14 at 13:59
    
Yes, that's true –  smonff Jun 17 '14 at 14:04
1  
Is there any chance that your CPU % rules are triggering a restart? Remove the CPU rules and try again. –  ewwhite Jun 17 '14 at 14:21
    
CPU rules were a problem here. –  smonff Jun 18 '14 at 7:46

1 Answer 1

up vote 1 down vote accepted

This is not what's supposed to happen. monit reload only rereads its config file and applies new changes. Do you have the same problem if you service monit restart?

How do you know Tomcat is actually restarting?

Please paste the output of monit status.

share|improve this answer
    
I know it restarts because I see it restarting in the logs ! Updated the question with monit status output. Will try what you advice later. –  smonff Jun 17 '14 at 13:45
    
Also post your monit configuration. –  ewwhite Jun 17 '14 at 13:45
    
Pastes done. Thank you. –  smonff Jun 17 '14 at 13:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.