Collecting useful server information
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 tell开发者_JAVA技巧s 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...
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?
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[""];
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
精彩评论