Files
Bash_Scrips/OpenShift Stuff/collect_info.sh
2025-06-23 21:19:51 +02:00

13 lines
847 B
Bash

#!/bin/bash
#Roy Cohen :roy@wondercohen.nl
#objective :colection script for run_collect_info.sh this script collects the Total Processors, Memory RAM Total Disk size per host.
#First line of code :09/10/2019
#last update :11/10/2019
#version :0.1
#synatx example of hostfile :<hostname,contract code> contract code must be in uppercase and my contain numbers
echo -e "\tMemory(RAM) Info\t"`free -mt| awk '/Mem/{print " \tTotal, " $2 }'`
echo -e "\t,Total Processor,\t"`grep -c 'processor' /proc/cpuinfo`
TOTAL_HDD_SIZE=$(df |grep "^/dev" |awk '{print $2}'|paste -sd+ | bc)
echo -e "\t,Disks size,\t "$(echo "scale=2; $TOTAL_HDD_SIZE /1024^2" | bc)