How can I check Windows Server 2008 health status and use them with Python

8,638

Give this a look for parts 1, 2 and 3: http://code.google.com/p/psutil/

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: http://alastairs-place.net/projects/netifaces/ 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 http://code.activestate.com/recipes/303339/ but it is unhelpfully only processes. There's a WMI Python module that can provide service information however: http://timgolden.me.uk/python/wmi/index.html

Share:
8,638

Related videos on Youtube

avimehenwal
Author by

avimehenwal

Computer Engineer exploring new technologies and trying to understand them better. Technology appretiator and kneen learner. Javascript, Python developer. New to web developmetn and designing. Love artistic and creative job :D

Updated on September 18, 2022

Comments

  • avimehenwal
    avimehenwal over 1 year

    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.