473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Uptime of system on network

does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report, they are all in a Active Directory domain... needs to
be in C# or VB.NET preferably. thanks!
Dec 12 '05 #1
4 2748
Brian,

You could just have a service running on the server which will take note
when it starts. Then, to get the uptime, you can call to the service, and
take the difference between the current time and the time that the system
went up.

You could use remoting to access this information as well.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Henry" <no****@nospam.com> wrote in message
news:OW*************@tk2msftngp13.phx.gbl...
does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report, they are all in a Active Directory domain... needs
to be in C# or VB.NET preferably. thanks!

Dec 12 '05 #2
Brian Henry wrote:
does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report

[...snip...]

You might check the System EventLog for the youngest event like #6009 (forr
boot up). This can be done with a pure .net solution.

Dec 13 '05 #3
Another possibility is Environment.TickCount. This returns the Number of
milliseconds since the last system bootup. When the System runs for more
than 24.9 Days (or 49.7 days, when you are pInvoking GetTickCount), the tick
count will wrap around, though.
Dec 13 '05 #4

"Brian Henry" <no****@nospam.com> wrote in message
news:OW*************@tk2msftngp13.phx.gbl...
does anyone know of an easy way to say how long has a specific system been
up and running? I just need to get back the uptime of the servers on our
network for a report, they are all in a Active Directory domain... needs
to be in C# or VB.NET preferably. thanks!


You could use System.Management classes to query the servers WMI class
"Win32_Operatingsystem" "Lastboottime" property.

Willy.

Dec 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Oli Schwarz | last post by:
Hello, how can I read out the uptime of a unix system in python (Linux and *BSD). I have not found a uptime-function in the Library. Regards Oli
24
by: Esmail Bonakdarian | last post by:
Hi, Is there a way to display how long a Win XP system has been up? Somewhat analogous to the *nix uptime command. Thanks, Esmail
4
by: Brian Henry | last post by:
does anyone know of an easy way to say how long has a specific system been up and running? I just need to get back the uptime of the servers on our network for a report, they are all in a Active...
4
by: Dylan Parry | last post by:
Hi, I'm looking for a way to calculate the amount of time that Windows has been running since the last boot. Ideally I'd like to be able to create a DateTime object containing this value so that...
0
by: streamkid | last post by:
hello.. could anyone please help me build a uptime script for openbsd? i tried phpsysinfo, it doesn't work (only uptime works, and that's around 15k days :p) i tried these: <?php...
8
by: Guy Macon | last post by:
How to increase web server uptime with DNS failover: For illustration, let's start with some really bad hosting... Find four free web hosts that are each 90% reliable -- in other words they...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.