In order to accomplish this you have to have an account with password less login for all the server on the network you want to retrieve data
Here is my tutorial for password less login
Create a file "ips" which should contain all the ip's you want to retrive data for ( 1 ip per line )
for i in `cat ips`;do ssh -t $i 'echo -e -n `uname -n `" '$i' " ;cat /proc/cpuinfo | grep "cpu cores" | uniq';done > cpucores
( This one will not work in single core cpu's or vm's )
for i in `cat ips`;do ssh -t $i 'echo -e -n `uname -n `" '$i'" ;grep MemTotal /proc/meminfo ';done > Mem_details
for i in `cat ips`;do ssh -t $i 'echo -e -n `uname -n `" '$i' " ; sudo /sbin/fdisk -l | grep Disk ';done >hdd_details
( This one will not work in single core cup's or vm's )
After you run all the three commands you will have three files in your directory
1) cpucores - list servername ip-address and number of cores
2) Mem_details - list servername ip-address and memory details in kb
3) hdd_details - list servername ip-address and drive and size.
No comments:
Post a Comment