Once you've established that the server itself is up, then you can worry about if it's serving the content it's meant to be.

Maybe a parameter csv file with a format of network name and box function, something like this:

Code

micky,web donald,web minnie,dns goofy,mail

You run a standard bit of code using Net::Ping which returns the response as to if the server's up or not (it can use six different protocols to check) and then once you know the hardware is physically responding, based on the value in the parameter file you check to see if it's serving the content.

You'd use LWP for both micky and donald, maybe Net::DNS for minnie and a quick search of CPAN should give you some ideas for how to query goofy.

You'll always earn more respect by searching the web, forums, having a go, and then posting. That way it shows you're interested in finding out the answer and not just getting the code written for you.

Basically my aim is i have about 12 servers all over the place some dns some web servers some samba and so on . What i need to do is be able to tell that they are all runing , Like if u look at the first post some great guys on here got that bit going for me . Thats all cool and checks ips andweb pages but what i found if i put my dns server in or my samba ip in it fails . I belive the reason for this is the code we used first only works on web servers or things serving web pages.

I dont no per very well at all and am trying to get my head aroudn it .

So. You have a number of servers that perform various functions and you need to test if a) each server is alive and b) if it's performing the function it's supposed to perform.

I suggest that you use Net::Ping to check the first part (strictly, that will check that the server is alive and that you have network connectivity to the server - but that's the best you can reasonably expect) and only if that test is successful then you should go on and check the second part.

To check for various network functions, the best way is obviously to make a request to the server and see if you get a response. For web servers you obviously make an HTTP request as we did earlier in the week.

For DNS servers it will be a little harder. You have to understand the difference between requesting the DNS details for a server and running DNS queries on a server. You need the latter. Net::DNS allows you to specify a particular nameserver when creating a resolver object - that's what you need to use.