0

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)

Poma
  • 1,289
  • 6
  • 22
  • 35

4 Answers4

1

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

minaev
  • 1,549
  • 12
  • 13
0

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.

Khaled
  • 35,688
  • 8
  • 69
  • 98
0

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

cjc
  • 24,533
  • 2
  • 49
  • 69
-2

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

mailq
  • 16,882
  • 2
  • 36
  • 66
  • 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