|
|
|||||||
For the past several months, we have been using a product called SuperScout with Microsoft Proxy 2.0 to monitor web access by our users. Unfortunately, the SuperScout program seems to cause proxy/IIS to generate Dr. Watson errors on rare occasion. So, I have devised a script that uses BLAT to send an email to me or a co-worker when the proxy service stops. I do this by polling the Dr. Watson log size. Ideally, SurfControl would fix their product, but this hasn't happened, yet. What I would like to do is to automatically restart the web proxy and default web service whenever these errors occur. This way, I don't have to run back to the server every time the proxy errors out. I have looked into the adsutil.vbs script, and I have a little understanding, but I'm not sure it is adequate. Generally, I right click on web proxy, then start, then I right click on default web server, then start (in iis.msc). This is all that is necessary. I would assume there is a way to do this via kixtart. Any help you can give me would be greatly appreciated!!! Brian |
||||||||
|
|
|||||||
I would think that you should monitor the service and not necessarily the DrWatson log file. Here is some code to that should point you in the right direction. Let me now if I missed your intended target. code:;Status of service. The values can be found in the following list: Status Constant [ 08 May 2002, 15:55: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
Maybe I SHOULD monitor the service, but I'm not sure it will help me that much. I still have to clear the Dr. Watson error that appears. The error has always been the same. (We've logged something like 30 of these errors on each of 3 proxy servers.) Does the "ADS_SERVICE_ERROR" get set when Dr. Watson is called? I will also need to close the Dr. Watson error that has popped up... Let me tool around with this a bit.. Brian |
||||||||
|
|
|||||||
On my Terminal Server, I just disable Dr. Watson entirely. To disable Dr. Watson from running, from start | Run | drwtsn32.exe Clear all check marks from Options boxes To reenable Dr. Watson type drwtsn32.exe -i in the run box |
||||||||
|
|
|||||||
If you're running Proxy2 on Win2k, you should be able to set the service to monitor itself and restart. If you're on NT4, I believe there's a ResKit util that'll do that for you. |
||||||||
|
|
|||||||
Otherwise, have a look at Servers Alive. I know, this is not the place to mention it, but it is a neat tool which is cheap and does the job well. Have a look at the site of Servers Alive. |
||||||||
|
|
|||||||
Disabling Dr. Watson isn't an option at this point. We are still waiting on the company to resolve the problems with their software, so we need a log of errors. Howard's solution works fine except that as the service is starting I get the return code of 8... so I will have to put a delay in there... might just be easier to use "net start"... Brian |
||||||||
|
|
|||||||
Howard: I'm using WinNT 4.0. The script you posted only works on Windows 2000. I couldn't get the line $service=$computer.GetObject("Service","ClipSrv") to work. It gives me an error. Brian |
||||||||
|
|
|||||||
Do you have ADSI installed on your NT4 computer? I would assume that much but had to ask. "ClipSrv" is a W2K service name and only included as an example. You would have to substitute the correct service (short names) "W3SVC" etc. Here are the services our Proxy2 server use. :Down net stop w3svc net stop msftpsvc net stop iisadmin /y set process="inetinfo" call :Killprocess net stop mailalrt net stop mspadmin set process="DRWTSN32" call :Killprocess set LogText=Proxy Service has been stopped. call :Log goto End :Up net start mspadmin net start mailalrt net start iisadmin net start msftpsvc net start w3svc |
||||||||
|
|
|||||||
We use HP Openview to monitor the INETinfo process in order to determine if proxy is up or not. |
||||||||
|
|
|||||||
I don't know if we have ADSI installed. We don't have any win2k servers, yet, so this may be a worthless pursuit until then. I don't have a great understanding of how all this stuff relies on ADSI. Interestingly, though, the adsutil.vbs script seems to enumerate objects just fine... maybe I'll just go ahead an use it... or stick with net start and net stop. Brian |
||||||||
|
|
|||||||
Ok.. now that it comes right down to it, what I really need is a script that allows me to reactivate the filter w3proxy on Windows NT4 Server. The path should be: IIS://computername/W3SVC/1/Filters/w3proxy or something similar. I noticed that there is no way to run a "net start w3proxy"... because it comes back with the message that the service doesn't exist. I can start the w3svc, but for some reason it doesn't reload the w3proxy. I'm not sure it makes a difference if I do a "net stop w3svc" then a "net start w3svc"... Can anyone help? Brian |
||||||||
|
|
|||||||
Please revisit the list of services above. I think you want "iisadmin". The message above details the stops and starts for shutting down and starting up our MSproxy 2.0 services. |
||||||||
|
|
|||||||
I think you're right, Howard.. upon further review.. I think I was being too nitpicky and trying to make it to "neat". Stopping the IISADMIN and W3SVC then restarting them should do the trick. ISAPI filters are loaded when the IISADMIN service is loaded. Yes, there has to be some way reload ISAPI filters outside of restarting IISADMIN, but Microsoft has not been so kind as to document how (in so far as I've looked -- MSDN, etc). So.. I've settled on the method: code:Ah well.. I guess i'll have to live with 30 seconds downtime instead of 10 or 15..shell '%comspec% /c net stop W3SVC' Brian |
||||||||
|
|
|||||||
Since you posted this in the COM forum, I think that you should install ADSI and use the code provided above instead of that nasty "SHELL net stuff". [ 08 May 2002, 21:55: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
Yeah.. well, I wanted a COM solution.. none has been forthcoming.. IIS has ADSI capabilities whether NT does or not. Brian |
||||||||
|
|
|||||||
Try this. If it does not work because ADSI is not there, you can DL it from the link in my previous post. code:$computer = GetObject("WinNT://@wksta,computer") |
||||||||
|
|
|||||||
Well, unfortunately, simply stopping and starting the services does NOT reactivate proxy properly after a crash. So, I'm still looking for a solution that simply turns on the proxy the same as the IIS.msc allows you to do it by right clicking on the service and clicking start. Other methods cause errors in the event log... Brian |
||||||||
|
|
|||||||
I need a help. I have to check on several wks if there are some IIS webserver. Do you think that using Com looking for the iisadmin service is right. Thanks for your help |
||||||||
|
|
|||||||
Do you want to see if IIS is installed or if it is running a webserver or what specifically? COM is a great way to do this. Brian |
||||||||
|
|
|||||||
brian, can I ask why you use IIS proxy? it's well known fact that is slow as sh*t... it's working fine on server which is not used for any other purpose and which has no much simultaneous queries, but when you go over 20 queries you need a super computer for the proxy to work properly on IIS... well, perhaps you {edit} have {/edit} one doing that. cheers, [ 20 June 2002, 15:42: Message edited by: Lonkero ] |
||||||||
|
|
|||||||
I use IIS Proxy because....... It was someone else's project which I inherited and am not allowed to change. Brian |
||||||||
|
|
|||||||
sad... this happens when you have tight *ss boss... have heard similar stuff before. I'm glad my boss trustes what I say. as an example: "I was working that day 10 hours. I just didn't have time to come to office." cheers, |
||||||||
|
|
|||||||
I would like to know how to check both if IIS is installed and if a web server is running. |
||||||||
|
|
|||||||
Here is a little script whipped up just for you.. (although I'm positive there is a UDF somewhere that basically does this): code:You can get by with crossing into another domain to see if IISADMIN is installed as long as your administrator passwords match. However, you may have trouble finding out the status of the service unless you can authenticate properly on the domain in question. Essentially, this works best if you only run from the domain you're checking.break on Brian |