Page 1 of 2 12>
Topic Options
#85639 - 2002-05-08 03:22 PM HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85640 - 2002-05-08 03:54 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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 
;ADS_SERVICE_STOPPED 0x00000001
;ADS_SERVICE_START_PENDING 0x00000002
;ADS_SERVICE_STOP_PENDING 0x00000003
;ADS_SERVICE_RUNNING 0x00000004
;ADS_SERVICE_CONTINUE_PENDING 0x00000005
;ADS_SERVICE_PAUSE_PENDING 0x00000006
;ADS_SERVICE_PAUSED 0x00000007
;ADS_SERVICE_ERROR 0x00000008


$computer = GetObject("WinNT://@wksta,computer")
? @serror
$service = $computer.GetObject("Service", "Clipsrv")
? @serror
$rc = $service.Status
? "Status=$rc"
If $service.Status <> 4
$service.Start
EndIf
get $_
If $service.Status <> 1
$service.Stop
EndIf
$rc = $service.Status
? "Status=$rc"



[ 08 May 2002, 15:55: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85641 - 2002-05-08 04:04 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85642 - 2002-05-08 04:11 PM Re: HELP with Microsoft IIS/Proxy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85643 - 2002-05-08 04:18 PM Re: HELP with Microsoft IIS/Proxy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#85644 - 2002-05-08 04:33 PM Re: HELP with Microsoft IIS/Proxy
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 376
Loc: Netherlands
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.
_________________________
Kind regards,

Top
#85645 - 2002-05-08 04:35 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85646 - 2002-05-08 05:27 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85647 - 2002-05-08 05:38 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Do you have ADSI installed on your NT4 computer? I would assume that much but had to ask. [Wink]

"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
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85648 - 2002-05-08 05:43 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
We use HP Openview to monitor the INETinfo process in order to determine if proxy is up or not.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85649 - 2002-05-08 06:06 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85650 - 2002-05-08 08:36 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85651 - 2002-05-08 09:37 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85652 - 2002-05-08 09:48 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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:
shell '%comspec% /c net stop W3SVC'
shell '%comspec% /c net stop IISADMIN'
shell '%comspec% /c net start IISADMIN'
shell '%comspec% /c net start W3SVC'

Ah well.. I guess i'll have to live with 30 seconds downtime instead of 10 or 15.. [Smile]

Brian

Top
#85653 - 2002-05-08 09:55 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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". [Big Grin]

[ 08 May 2002, 21:55: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85654 - 2002-05-08 09:59 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Yeah.. well, I wanted a COM solution.. none has been forthcoming.. [Razz] IIS has ADSI capabilities whether NT does or not. [Smile]

Brian

Top
#85655 - 2002-05-08 10:13 PM Re: HELP with Microsoft IIS/Proxy
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
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")
$service1 = $computer.GetObject("Service", "iisadmin")
$service2 = $computer.GetObject("Service", "w3svc")
$service2.Stop
$service1.Stop
$service1.Start
$service2.Start

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85656 - 2002-05-13 03:51 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
#85657 - 2002-06-20 09:51 AM Re: HELP with Microsoft IIS/Proxy
robbocop Offline
Fresh Scripter

Registered: 2002-02-18
Posts: 5
Loc: Rome Italy
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

Top
#85658 - 2002-06-20 03:37 PM Re: HELP with Microsoft IIS/Proxy
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
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

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
2 registered (Allen, ShaneEP) and 158 anonymous users online.
Newest Members
Sjaak, Biybucket, Markus1961, Ian231, kixnewbie12
17480 Registered Users

Generated in 0.046 seconds in which 0.014 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org