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


In reply to Re: Monitor webserver status on all machines in a subnet by Abigail-II
in thread Monitor webserver status on all machines in a subnet by chimni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.