# Script for monitoring website or port and send email



## roddierod (Dec 15, 2010)

Before I reinvent the wheel or spend any amount of time writing it myself, does anyone know of a script that will do the following:

   a) monitor port 80 (or any port really) for a connection. 
      Alternatively, could be a script monitoring apache site connections

   b) send an email notifying of the connection, possibly even disconnect

Other "would be nice" features:
    - look up whois information of the connecting party and send it in the email
    - only send email for certain party connections 
    - send information of what pages are being browsed or files downloaded

The reason for the emailing is I want to remotely monitor my machine without having to ssh into it or such.


----------



## jalla (Dec 15, 2010)

How many hits do you expect on that that webserver per hour, per day, etc?
Are you sure want to generate mail for each connection??

Unless you have an extremely low volume of traffic, I'd say you should be looking for some tool to do periodic reports from your http-logs


----------



## roddierod (Dec 15, 2010)

Very small, less than 10 hits a day. I use it as a testing server or I dump files for people to retrieve. Occassionally I forget to clean up the files, so I just want something to let me know, that so and so actually went to the site and check something out.


----------



## SirDice (Dec 15, 2010)

Imagine about a million real "hits" (page requests) and another million or so half-open connections per day. I'm sure your mailbox will start screaming bloody murder :e

Having this information in (near) real time is pretty much useless. Just generate periodic reports from your webserver's access and/or error log, perhaps combined with logging from your firewall.


----------



## ProFTP (Dec 21, 2010)

monit
monitord
etc


----------

