0

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.

longneck
  • 23,082
  • 4
  • 52
  • 86
Dom
  • 75
  • 1
  • 11
  • 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 04 '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 04 '13 at 17:23

1 Answers1

1

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!
Stephan
  • 999
  • 7
  • 11