Possible Duplicate:
What tool do you use to monitor your servers?

How to get notified (preferably by email) when my webserver reaches certain amount of incoming requests? This way I'll be able to quickly react ddos, bruteforce etc.

I'm using apache through nginx proxy, so I'm able to monitor either of them (preferably nginx)

link|improve this question

feedback

closed as exact duplicate by mailq, ErikA, Ward, WesleyDavid, Scott Pack Dec 27 '11 at 15:25

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

4 Answers

up vote 1 down vote accepted

If you have Munin, you can use it to send notifications. First, install a plugin to monitor request rate in Nginx (like this one). Then follow the instructions in Munin documentation: Sending Alerts from Munin. An even shorter introduction may be found here: Email Notifications from Munin

link|improve this answer
I did exactly like this. Works perfectly! – Poma Dec 29 '11 at 12:21
feedback

You can use monitoring software like nagios to setup notifications (by email/SMS etc). You can define your own notification commands. Also, you can define your check commands and the warning/critial threshold of each command.

link|improve this answer
feedback

For some basic monitoring:

Grab the Nagios check_nginx.sh script: http://exchange.nagios.org/directory/Plugins/Web-Servers/nginx/check_nginx-2Esh/details

(Nagios checks are generally scripts that will return specified exit codes for events -- 0 for OK, 1 for WARN, 2 for CRIT; you can use them outside of Nagios.)

Turn on the stub stats module in nginx and have it on http://localhost/stats or something like that: http://wiki.nginx.org/NginxHttpStubStatusModule#Directives

Point the check script at the stats URL: you'll see connections per second. Set a threshold for it with the -w or -c option. Wrap that in a shell script that will send you email if the script returns a non-zero exit code. Put the script into cron.

The page about the Nginx module has some links on the bottom about other monitoring options.

Other option:

You can install Monit (there's a free, self-supported package for most Linux distros). There's apparently some stuff on Apache monitoring here:

http://mmonit.com/wiki/Monit/MonitorApacheStatus

link|improve this answer
feedback

With monitoring software. In the upper right corner there is a search field you can use to find one.

link|improve this answer
That was very helpful answer – Poma Dec 25 '11 at 11:25
1  
@Poma This was a very vague question without doing any initial research. – mailq Dec 25 '11 at 11:29
I'm already using monitoring software like munin. Nagios is way too complicated for my simple single server. I asked about notifications and what approach should I use (shell script + cron, standalone app, apache module etc.) – Poma Dec 25 '11 at 11:48
"Nagios is way too complicated"? What? Nagios is relatively easy to get working. It is rather light weight and can do exactly what you want. If you already know better yourself, why ask us? :) – Frands Hansen Dec 25 '11 at 14:40
feedback

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