Checking and restarting IIS

General chat about HostMonitor (all messages posted before March 07, 2003 available here).
Locked
Guest

Post by Guest »

I'm testing HM and so far I must say it's great. What's the most efficient way to check and if the case to recover IIS web services on a remote machine? For ex. It could be that inetinfo is hanging and therefore I would have to kill it and then restart iisadmin, w3svc, smtpsvc and other related services, LDAP e.g. Must the script reside on the remote machine or is it possible to store it on the HM server? Thanks a lot.
Guest

Post by Guest »

This is a serious issue. Can you please reply?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think the best way to check IIS is "URL request" test. Of course you can use "Service" test and "TCP" test, however possible situation when IIS service works and answers for incoming TCP connections but does not answer for HTTP (FTP) requests.

Recover IIS is not so easy. In HostMonitor 1.xx you can specify only 1 service to restart. But to restart IISADMIN you have to stop dependants (MSFTPSVC, W3SVC), this is impossible in HostMonitor 1.xx. HostMonitor 3.xx is more flexible, I think you can create alert profile with actions defined like these:
1) Action "Change test interval", start after 1 consecutive bad result, repeat 1 time. Purpose: Set new short test interval, to stop/start services one by one. New interval can be 1 min (usually 1 min is enough to stop/start service)
2) Action "Stop service", start after 2 consecutive bad results, repeat 1 time. Service: W3SVC
3) Like item #2. Service: MSFTPSVC
4) Action "Restart service", start after 3 consecutive bad results, repeat 1 time. Service: IISADMIN
5) Action "Start service", start after 4 consecutive bad results, repeat 1 time. Service MSFTPSVC.
6) Like item #5. Service W3SVC
7) Action "send e-mail", start after 5 consecutive bad results, repeat 1 time.
Also, create "good" actions:
1) Action "Change test interval", start after 1 consecutive good result, repeat 1 time. Restore original value.

With this complicated alert profile when server goes down, HostMonitor must work in follow sequence:
1) set new interval to 1 min
2) stop W3SVC and MSFTPSVC
3) restart IISADMIN
4) start MSFTPSVC and W2SVC
5) if server still down, send e-mail (to admin), otherwise restore normal test interval.

Regards
Alex
Guest

Post by Guest »

Thanks, you were clear enough. That is certainly a possible solution. One more thing: what about scripting? As you know if HM would allow ro run one or more scripts consequently to a failure in getting the URL I could stop the services by executing a batch file containing the command: "Net Stop IISAdmin /Y" and restart them executing another script like this: "Net Start IISAdmin - Net Start W3svc - Net Start Msftpsvc - Net Start Smtpsvc - Net Start LDAPSvc". Should a script like this reside on the HM server? If yes, must it be a .HMS file? If no, must I install a remote console service on the target machine to be able to run my script?

Thanks a lot again. I hope you'll be as clear as in your previous answer.
Roberto
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Of course you can use NET START/STOP commands, but I am afraid it will work for local system only. HostMonitor cannot start process on remote system.

Regards
Alex
Locked