473,395 Members | 1,696 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,395 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 1863
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.