[Urgent help] Ansible for fetching and comparing windows OS configuration, performance stats

Hi All,

Is there a way to use Ansible to fetch Windows OS specific configuration using Ansible on demand ?
Is there a way to fetch OS updates, Open Ports, Windows Running Services list?
Is there a way to monitor Windows Performance Counters for a duration of time ?

Thanks,
Akash

Any answers to this would help a lot

Hi Akash,
For your second question I guess ansible having modules for updates and all, please check this

http://docs.ansible.com/ansible/latest/win_updates_module.html

For checking open port, there are couple of powershell script if you trigger that powershell script through ansible your will get output
For triggering the powershell script you can use win_shell module in ansible it will run on window server and perform the output you can write the output in some file and for audit purpose.

Thanks & Regards
Sumit Sahay

Hi, some suggestions below…

Hi All,

Is there a way to use Ansible to fetch Windows OS specific configuration using Ansible on demand ?

run or re-run the ansible setup module, which will gather lots of facts about your windows hosts.

Is there a way to fetch OS updates, Open Ports, Windows Running Services list?

win_updates module for OS updates.

You can use win_command or win_shell modules to run powershell to get a lot of this kind of information

get active network connections like this
ansible windows_hosts -m win_command -a ‘netstat -ano’

get running processes (visible to user you have connected as like this)

ansible windows_hosts -m win_shell -a “Get-Process”

get installed hotfixes like this:

ansible windows_hosts -m win_shell -a “Get-Hotfix”

Is there a way to monitor Windows Performance Counters for a duration of time ?

Not tried, but you could probably make use of these powershell functions to export performance data to graphite https://github.com/MattHodge/Graphite-PowerShell-Functions/tree/v1.1.0 - described here https://hodgkins.io/using-powershell-to-send-metrics-graphite

I’d recommend having a look at what you can do using powershell, at lot of useful administrative information is available via powershell, and its relatively easy to get at it using powershell.

If you need to process the raw results within ansible I’d recomend having a look at creating your own modules - once you have the powershell command to get the right information, its not much more work to turn it into an ansible module - you only really need to handle any module parameters and build up the information that it makes sense to return, and create a module documentation file.

Hope this helps,

Jon

Thanks a lot.

Hi All,

I want to store the data collected by Ansible from remote machines and then use the data for real time analysis, for Machine learning algorithms, etc. What data storage mechanism should I be using? Examples can be MongoDB , etc ?

Thanks,
Akash