I'm writing a batch of tiny scripts to automate various tasks at work, and one of the things thats been requested is a way to verify if a service such as smtp is running or not. I'm able to do a very simple script which opens a telnet connection to a given port then returns STOUT to the webpage, what I'd like to do however, is say I want to check for a webserver on xyz.com. Would there be a simple way to connect to it, verify its running the intended service, and present either a statement <a webserver is alive on this host> or create an image <green for yes, red for no>.
I'm trying to think of this in the simplest terms, nothing to snazzy. I'm just having a hard time thinking of how to create a way to do write this particular script. Thanks in advance.
Drew