monit-general
[Top][All Lists]
Advanced

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

Re: monit with nginx


From: Derek
Subject: Re: monit with nginx
Date: Tue, 26 Oct 2010 22:33:22 +1300
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5

Thanks for the reply,

I'm using this monit instance to check other nginx servers for availability, so this is done all remotely using public IP's.

There are local checks running on each web server to monitor nginx locally also, this was using a tcp check on port 80.  However I updated the local checks to your line below (if failed port 80 protocol http then restart).  This also gave the 400 back using localhost..

In both cases the syslog shows..
HTTP error: Server returned status 400
'domain.co.nz' failed protocol test [HTTP] at INET[123.456.789.10:80] via TCP

What version of monit are you running?

Cheers,
Derek


On 26/10/10 8:21 PM, António P. P. Almeida wrote:
On 26 Out 2010 00h29 WEST, address@hidden wrote:

[1  <multipart/alternative (7bit)>]
[1.1  <text/plain; ISO-8859-1 (7bit)>]
Hi All,

I have a number of servers running nginx in my environment.  Also
using monit to monitor they are up and responding to port 80.

I'm seeing "Server returned status 400" from monit and would like to
solve this issue.

This combination works fine on monit 5.0.3, however gives the 400
error on servers running 4.10.1.  I found a few google hits on this
like this one -
http://serverfault.com/questions/131888/nginx-wont-respond-to-monit

Does anyone have any ideas?
I'm running monit with Nginx with no problems. It shows up properly in
the access logs.

check process nginx with pidfile /var/run/nginx.pid
  group webserver # webserver group
  start program = "/etc/init.d/nginx start"
  stop program  = "/etc/init.d/nginx stop"
  ## Test port 80 and request the server status page. Restart if the
  ## server is down.
  if failed port 80 protocol http then restart
  ## If the restarts attempts fail then alert.   
  if 3 restarts within 5 cycles then timeout
  depends on nginxd
  depends on nginx_init
  alert address@hidden only on {timeout}    

## Test the nginx binary.
check file nginxd with path /usr/sbin/nginx
   group webserver
   if failed checksum then unmonitor
   if failed permission 755 then unmonitor
   if failed uid root then unmonitor
   if failed gid root then unmonitor
   alert address@hidden  

## Test the init scripts.
check file nginx_init with path /etc/init.d/nginx
   group webserver
   if failed checksum then unmonitor
   if failed permission 755 then unmonitor
   if failed uid root then unmonitor
   if failed gid root then unmonitor
   alert address@hidden

This assumes that 127.0.0.1:80 has Nginx listening in. What does it
shows in the logs?

--- appa


reply via email to

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