Experts !!! Please advise

Hi,

I work on sun Solaris. Am hosting few web services on my server which are accessed over the internet. Now to check whether the web service is responding or not, i first have to log in to the web service URL. If it doesn't respond there, i come back to my server box and restart the service process.

What am looking here is a way by which i can directly check at the server whether the process is responding or not. Like a script or cron job. I can see the process is running or not by using multiple commands and eventually its PID but how do i check whether the process is responding or is it hung.

Regards
Rahul miau

The only real way to test a service is to test that service.

Even if you app is designed to respond to something other than your web service, that could still work when your web service is hung.

It'd be better if you found out why your service is failing.

Using Solaris D-trace. This tool for debugging is ideal for resolving problems like bottleneck and if you want to know what is going on in the system Dtrace is ideal for that job

And how would one tell an idle service that's not doing anything because no one's using it at the moment from a hung service that's not doing anything because it's broken?

You get right back to having to run the service itself to see if it works.

It's really hard to test a given functionality by implementing some other functionality that doesn't exercise the actual thing you're trying to test.

It's a lot easier to test if you car's brakes work by stomping on the brake pedal than it is to design and implement some system to measure acceleration and forces in a bunch of different places and then try to infer if your brakes are working from the data you collect. And if your brakes do keep failing, you put your effort into identifying the failure and fixing them.

man truss

(ok you will get less details than with Dtrace, but maybe you can start with that)