I'm trying to get a baseline on a number of physical Linux servers before we convert them to virtual machines, that way we know what to allocate.
I fooled around with a few of the command line stuff, mpstat -P ALL, iostat -d -m -h -t, and sar before I decided on a basic script such as the following
Code:
[user@server scripts]$ cat cpu_memory_resources
#!/bin/bash
# 11/18/2014
# Gathering memory, cpu and i/o for this serveri every 15 minutes
echo
printf "%s\n" "##############################################################"
printf "%s `hostname` `date`\n"
printf "%s\n" "##############################################################"
echo
printf "%s\n" "MEMORY STATS IN GIGABYTES"
echo
free -g
echo
printf "%s\n" "ALL CPU STATS"
echo
mpstat -P ALL
echo
printf "%s\n" "IO STATS FOR ALL DISKS IN MEGABYTES"
echo
iostat -d -m -h
echo
The formatting wasn't what we wanted it to be, along with it would be awesome if we could get an average for say on the hour for a 24 hour period. I was thinking maybe use AWK, however I not that familiar with it.
I settled on using the following:
Code:
vmstat -a -S m 8640 3660 > outputfile
Can anyone recommend a better way to caputre this information and clean it up?
thanks