Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a project for which I need to create a Python class which can determine underlying OS on which it is running and performs a sequence of checks if OS is found to be Windows Server 2003/2008.

Currently my check includes following parameters:

  1. CPU Utilization Check
  2. RAM Utilization Check
  3. HD Volume space available
  4. Well configured network parameters like DNS and DHCP
  5. RDP and other critical application services running

For 1 to 3 information can be extracted from Windows Task Manager BUT the question in HOW ?

For 4, ipconfig /all output would be fine and I think I would be able to extract them either from some python modules or regex ! (Believe me I am not sure)

For 5, I think I should use powershell trimmed Get-Services output.

I look foreward to seek help on points 1 to 3

  1. How can I extract this information from windows machine ?
  2. How can I use that information for further processing in Python ?

Apart from this any type of suggestion/query/improvements/known issues are most welcome.

share|improve this question
up vote 0 down vote accepted

Give this a look for parts 1, 2 and 3:

As for network parameters, you might have a bit better luck with parsing the output from the following command: netsh interface ipv4 show config for interface configuration and DNS. However you can also try this: It doesn't give very friendly interface names on Windows but works. However I don't think it shows whether you're using DHCP or what you're using for DNS.

Lastly for 5 there is but it is unhelpfully only processes. There's a WMI Python module that can provide service information however:

share|improve this answer
Thanks @Brayden ! I am working on with links suggested. – Avi Mehenwal Feb 20 '13 at 6:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.