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.

I'm using Nginx to reverse proxy a nodejs instance that is currently timing out when an external service attempts to call a specific, secured api endpoint, generating 504 errors.

How can I setup Nginx to notify me (ie. via email) when it serves a 504? Because the api endpoint in question is secured and relies on specific information being passed, a generic monitoring solution won't work.

I'm very surprised I couldn't find any clear information on how to do this after googling for 15 mins.

Thanks.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You don't use Nginx for this. Rather, you use some sort of log processing package to watch the nginx error log for 504s and notify you when it sees one.

Logstash is a very popular and very capable log processing package - it can be easily configured to consume messages out of your error log (using the file input), look for a certain error string (using the grep filter), and then email an alert if it finds a matching line (using the email output).

share|improve this answer
    
thanks EEAA - knew I must have been looking for the wrong thing. –  max Oct 12 '13 at 18:54
    
logwatch/swatch might be usefull tools too if you want a simpler setup than logstash. –  that guy from over there Oct 13 '13 at 8:28

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.