How to Determine "Server Up Since" Time? 
Author Message
 How to Determine "Server Up Since" Time?

Okay,

I give up. After searching the registry, SQL server stored procedures,
various built-in scripting objects - I can't find it.

How can I determine, when the current NT had been started, or alternatively,
when IIS had been started, or any service, for that matter? The closest I
come is the Performance Monitor, Server -> System Up Time.

Best Regards
Andy Schmidt

H&M Systems Software, Inc.
25 East Sping Valley Avenue
Maywood, NJ 07607-2150
U.S.A.

Phone: +1 (201) 845-3357, x20
Fax:     +1 (201) 845-4638



Fri, 21 Dec 2001 03:00:00 GMT  
 How to Determine "Server Up Since" Time?
How does one assign and access application specific variables?
Quote:

> For IIS service, why not put an application variable in global.asa to record
> the time the service was started?   You assign the time value on application
> start event.



Sat, 22 Dec 2001 03:00:00 GMT  
 How to Determine "Server Up Since" Time?
Hi Andy,

You can use ADSI within ASP to check to see if a service is running.  This
code checks the w3svc (WWW Publishing Service) if it's running:

<%
 Set sService = GetObject( "WinNT://your_server/w3svc" )

 Response.Write sService.Name & " - " & sService.DisplayName & "<BR>"
 Select Case sService.Status
 Case 1
  ' Service is stopped
 Case 4
  ' Service is running
 End Select

 Set obj = Nothing
%>

In order to execute the sService.Status function, you need to be
authenticated on the IIS server you are accessing (some account with admin
priv., with either BASIC or NTLM).

HTH,
Matt

BTW, please refrain from cross-posting.


Quote:
> Okay,

> I give up. After searching the registry, SQL server stored procedures,
> various built-in scripting objects - I can't find it.

> How can I determine, when the current NT had been started, or
alternatively,
> when IIS had been started, or any service, for that matter? The closest I
> come is the Performance Monitor, Server -> System Up Time.

> Best Regards
> Andy Schmidt

> H&M Systems Software, Inc.
> 25 East Sping Valley Avenue
> Maywood, NJ 07607-2150
> U.S.A.

> Phone: +1 (201) 845-3357, x20
> Fax:     +1 (201) 845-4638



Sat, 22 Dec 2001 03:00:00 GMT  
 How to Determine "Server Up Since" Time?
Hi Ben,

dim sVariable
application.lock
application("myvariable") = "this is a test"
sVariable = application("myvariable")
application.unlock

HTH,
Dan

Quote:

>How does one assign and access application specific variables?


>> For IIS service, why not put an application variable in global.asa to
record
>> the time the service was started?   You assign the time value on
application
>> start event.



Sat, 22 Dec 2001 03:00:00 GMT  
 How to Determine "Server Up Since" Time?
Hey there,

Quote:

>For IIS service, why not put an application variable in global.asa to
record
>the time the service was started?   You assign the time value on
application
>start event.

The problem with this is that Application_OnStart is only called the first
time the application is accessed - not when the server starts. So if the
server is running for three days before anyone hits the site, then you will
be out by three days...

Peter

--

Please don't send questions to me personally - post to the groups
JScript FAQ: http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Sun, 30 Dec 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CreateObject("Excel","//server"), MsgBox output

2. how to determine "last week"

3. How to Determine "Server Up Since" Time?

4. Err.Description returns "" all the time

5. Script Control "Taking a long time"

6. Disabling "BACK"/"FORWARD" buttons

7. Problem With "window.showmodaldialog("")"

8. Disabling "BACK"/"FORWARD" buttons

9. Need "server push" functionality in MSIE

10. jscript "server threw error"

11. Problem with Server.CreateObject("Scripting.Dictionary")...

12. "Server" was not handled

 

 
Powered by phpBB® Forum Software