I have over 100 Linux machines and need to gather some basic inventory information in a CSV format. Specifically, I'm looking to collect the following data for each machine:
- CPU cores
- Threads per core
- Total storage
- Total memory
- Used memory
- Used storage
I'm not after in-depth stats; just straightforward numbers that I can use for a dashboard. Any suggestions on how to quickly get this info?
4 Answers
If you can SSH into every box using key authentication, consider writing a script to collect the data and format it into a CSV. You can either have this script on all machines and run it remotely, or have a single script that executes commands via SSH for each metric. This way, you can run the script from one central box and get everything in one go.
You might want to consider using Ansible! It can simplify the whole process. First, create an inventory file listing all your servers. Then you can run a command like:
`ansible all -i inventory -m setup -a "filter=ansible_processor,ansible_processor_*,ansible_memory_*,ansible_mounts" --tree ~/test123 -k`
This will prompt you for your SSH password, or you can remove the -k flag if you're using key authentication. This will create a directory in your home folder with all the data you need.
While Ansible is a solid choice, if you're after ongoing monitoring, you might want to look into using a monitoring solution like Zabbix or Prometheus. They’re great for tracking metrics continuously rather than just pulling a one-off inventory. CheckMK and Grafana are also good options depending on how in-depth you want to go.
If you're just looking for lightweight stats, give Netdata a shot. It's easy to set up and gives you a real-time view of your systems without a ton of hassle.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures