recap_oneliner
Command for navigating through recap/rs-sysmon easier
Recap:
1 |
echo -e "\nActive users:" ; w -h | grep - v rack; echo -e "\n" ; \sar -q -s ` date -d '-3 hour' +%T`; cd /var/log/recap ; echo "" ; ls -ltr resour* | tail -n 10 ; echo -e "\n\nTime?" ; read vr2; echo "" ; ls -ltr resources* | grep $vr2 | cat $( awk '{ print $NF }' ) | egrep -m 2 -A 15 "UPTIME report | cut -b 119- |Top 10 cpu using processes" ; unset vr2; echo "" ; |
rs-sysmon:
1 |
echo -e "\nActive users:" ; w -h | grep - v rack; echo -e "\n" ; \sar -q -s ` date -d '-3 hour' +%T`; cd /var/log/rs-sysmon ; echo "" ; ls -ltr resour* | tail -n 10 ; echo -e "\n\nTime?" ; read vr2; echo "" ; ls -ltr resources* | grep $vr2 | cat $( awk '{ print $NF }' ) | egrep -m 2 -A 15 "UPTIME report | cut -b 119- |Top 10 cpu using processes" ; unset vr2; echo "" ; |
Splitting Recap logs
Every day the recap logs are concanentated into a single file. If you wish to break them into multiple files you can use the following. Note, you will need to replace 2017-07-04 with the date and ps_daily_20170704.log with the daily log file:
1 |
awk '/^2017-07-04/{x=$0;next}{print > "ps."x;}' ps_daily_20170704.log |
1 |
awk '/^2017-07-04/{x=$0;next}{print > "resource."x;}' resource_daily_20170704.log |
1 |
awk '/^2017-07-04/{x=$0;next}{print > "mysql."x;}' mysql_daily_20170704.log |
recap_oneliner.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1