# Simple Server Checks

**URL:** <https://forum.ansible.com/t/simple-server-checks/24355>\
**Category:** Ansible Project\
**Created:** [April 29, 2017, 9:02am UTC](https://forum.ansible.com/t/simple-server-checks/24355 "2017-04-29T09:02:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Wright](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@Gary\_Wright](https://forum.ansible.com/u/Gary_Wright)\
**Post date:** [April 29, 2017, 9:02am UTC](https://forum.ansible.com/t/simple-server-checks/24355/1 "2017-04-29T09:02:46Z")

</div>

Hi Guru’s,

I am currently evaluating Ansible and a quick win would be be to be able to use Ansible for checking pre-built servers against set criteria.  
Some of this can be obtained from facts, but but how do I access these and check that say all file systems have \> xMB free?

To summarise, any guidance or examples to perform the following would be greatly appreciated.

How do I check that a fact meets set criteria (eg RAM \> xMB)  
How do I run a Linux command or PowerShell command and check the output (does output contain string XYX or is value \> x)

What are the best practices regarding the running of playbooks/roles and processing the output…  
Do you try and use Ansible for all checking? OR should I run with -v and process the returned output using Linux scripts?

I don’t want to go down the wrongf route and want to keep the use of use of Ansible simple so its easy to develop/run/maintain.

Cheers.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 1, 2017, 6:25pm UTC](https://forum.ansible.com/t/simple-server-checks/24355/2 "2017-05-01T18:25:50Z")

</div>

You can add assert/fail tasks to your play that use the facts and  
calculate the needed parameters.
