# To extract information from all hosts.

**URL:** <https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494>\
**Category:** Ansible Project\
**Created:** [December 23, 2022, 9:48am UTC](https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494 "2022-12-23T09:48:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivakumar\_Venkatasw](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Shivakumar\_Venkatasw](https://forum.ansible.com/u/Shivakumar_Venkatasw)\
**Post date:** [December 23, 2022, 9:48am UTC](https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494/1 "2022-12-23T09:48:31Z")

</div>

Hi All,

I’m looking for extract information like Load, memory usage, uptime,swap space from all linux servers in csv farmat. could please anyone suggest playbook for the same.

Regards,  
Shivu

---

<div class="post-metadata">

**Author:** ![Will\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@Will\_McDonald](https://forum.ansible.com/u/Will_McDonald)\
**Post date:** [December 23, 2022, 10:27am UTC](https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494/2 "2022-12-23T10:27:54Z")

</div>

The Ansible setup module will give you facts about target systems including memory usage, uptime,swap space, it would be fairly simple to extend this with a custom fact to also grab the contents of /proc/loadavg

See [https://docs.ansible.com/ansible/latest/collections/ansible/builtin/setup\_module.html](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/setup_module.html) or run ‘$ ansible-doc setup’

Reading between the lines though, it sounds like you have been tasked to use ansible as an ersatz monitoring solution? Scheduling ansible runs against a number of hosts to grab runtime stats might not be the most efficient use case, you may want to investigate dedicated tooling like Sensu, Nagios, Zabbix or similar.

---

<div class="post-metadata">

**Author:** ![OSiUX](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/osiux/32/263_2.png) [@OSiUX](https://forum.ansible.com/u/OSiUX)\
**Post date:** [December 25, 2022, 9:29pm UTC](https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494/3 "2022-12-25T21:29:39Z")

</div>

try ansible-cmdb

[https://ansible-cmdb.readthedocs.io/en/latest/](https://ansible-cmdb.readthedocs.io/en/latest/)

---

<div class="post-metadata">

**Author:** ![Dennis\_McCarthy1](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Dennis\_McCarthy1](https://forum.ansible.com/u/Dennis_McCarthy1)\
**Post date:** [December 29, 2022, 6:35pm UTC](https://forum.ansible.com/t/to-extract-information-from-all-hosts/37494/4 "2022-12-29T18:35:49Z")

</div>

I’ve tried ansible-cmdb but it doesn’t work as well as I would like and it’s not been updates for a long time. I did try and contact the author as i had some ideas to make it better but got no reply.

I created this to solve the same problem but I store the results in a mongoDB. I created an ansible-galaxy module for it here: [https://galaxy.ansible.com/apidb/ansibledb\_opensource](https://galaxy.ansible.com/apidb/ansibledb_opensource)

You can extend standard facts by adding the custom\_extensions role which integrates with ansibleDB and gives you the ability to write your own facts and add them in so the setup module adds them int to the output: [https://github.com/apidb-io/custom\_extensions](https://github.com/apidb-io/custom_extensions)

There are lots of examples to pull out the data using JQ and add in comma delimiter output for excel.
