0

I want to add a page to an existing website with a list of practical system information about the server that's running the site. For example, which windows version, 32 or 64 bits, SQL Server version, some host variables, amount of RAM, disk space and whatever else. Basically, anything practical that could tell me more about the health of the server.
So, how do I get the most practical information through .NET?

Not important how it's going to be displayed but assume it's a list with three columns: Name of the setting, value for the setting and a description that tells what the setting is for... (The first two would already be enough, though, but for clarifications a description would be nice.)

One added complication, though: I need both 32-bits and 64-bits solutions...

Wim ten Brink
  • 25,901
  • 20
  • 83
  • 149

3 Answers3

1

have a look on this url http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx

and Request.ServerVariables Collection

e.g.

Request.ServerVariables[""];
Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
1

Use WMI counters:

http://msdn.microsoft.com/en-us/library/bb404655.aspx

EDIT:

See this questions for examples

How can I check for available disk space?

Community
  • 1
  • 1
jishi
  • 24,126
  • 6
  • 49
  • 75
  • This provides the most information so far. But is it useful? :-) – Wim ten Brink Mar 08 '11 at 12:44
  • 1
    WMI itself exposes all counters that you can find in the performance monitor tool, however some limitation is present in the .NET framework. I think you need to combine Environment and WMI for the examples you mentioned. – jishi Mar 08 '11 at 14:26
1

The best way to do this is using SNMP performance counters. This basically allows you to (through IIS) interact with system performance information.

Here is a list of performance counters

And here is a cool tutorial on how to use them

The_Butcher
  • 2,440
  • 2
  • 27
  • 38
  • Looks promising but security will nag a bit. It needs additional privileges and I'm not 100% sure it will get those on the server... – Wim ten Brink Mar 08 '11 at 10:41
  • they gonna complain about impersonation? :) – The_Butcher Mar 08 '11 at 11:59
  • 1
    SNMP actually maps directly to the WMI counters, so this would only be an advantage if you need to access counters that isn't supported in the .NET framework. – jishi Mar 08 '11 at 14:26