in reply to Monitor webserver status on all machines in a subnet

How to identify between webserver down(when it should not be) and no webserver on the machine
The only way to do that is to let the script have some knowledge which machines should run a webserver, and which ones shouldn't.
How to handle a situation where the webserver is running on some port other than default.
About the only way to do so is to check all possible ports to see if 1) something is listening, and 2) if that something talks HTTP.
are there any tools or script resources i can use
I see you are using nmap. nmap is great to determine what kinds of ports are listened on, and can determine lots of information related to IP, TCP and UDP. It does however not have lots of capabilities for application layers - just some stuff for RFC and proxy FTP. The fact that something is listening on port 80 doesn't mean the webserver is healthy. Unless you actually do a request and get a reponse, you'll know it. You might want to do a 'HEAD http://$ip/' and read the first 3 bytes of the response - although you might get an HTTP error code due to virtual hosting.

Abigail

  • Comment on Re: Monitor webserver status on all machines in a subnet