I am hoping someone can give me some help, as I am pretty new to Nginx. Thanks in advance.

Premise: I have a load balancing server (nginx upstream) in a test environment, load balancing between two web servers. I use the fail_timeout parameter because, if one server goes down, I cannot have it re-introduced until I have manually intervened, due to data integrity issues between the two.

Issue: I need to know that the server in question has been taken out of the loop. Email might be asking too much, but any event I can trigger would be very helpful.

Note: Whilst I have systems monitoring the servers, which should notify me if one goes down, it is more important that I know when the Nginx 'thinks' a server is down, in case the load balancing server cannot contact a given server, whilst the monitoring systems can, for whatever reason that might be.

  • What are you using to monitor the systems? You may be able to set it up to monitor the Nginx error logs, so when an upstream server looks down to Nginx and it gets logged, you can be informed by the monitoring software. – suitablyawesome Feb 4 '13 at 16:22
  • The system is a propriety one that checks a given website loads and emails out if it does not. I could create a cron job to check the log file and send an email, I suppose. I was just hoping for something tidier and more reliable. – Dom Feb 4 '13 at 17:23

Sounds like an ideal situation for monit, specifically the notifications feature. If the Nginx log spits out "server down" or some such, monit can email you or, better yet, email to your cell phone's text number registering an SMS message, or an email to Pagerduty to trigger it to call you. You call on how much noise you want it to make ;)

  • edit: was working on collectd while writing this. My bad; monit's the way to go here!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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