Skip to content

Instantly share code, notes, and snippets.

@aitseitz
Created January 3, 2023 09:04
Show Gist options
  • Save aitseitz/0db3144c3f1649896fea773b7e6db0ef to your computer and use it in GitHub Desktop.
Save aitseitz/0db3144c3f1649896fea773b7e6db0ef to your computer and use it in GitHub Desktop.
Collect system activity information with SAR
#!/bin/bash
INTERVAL=${1:-5}
COUNT=${2:-59}
today=`date +%Y-%m-%d`
sar -u $INTERVAL $COUNT >> ~/log/sarstat-${today}.out
@aitseitz
Copy link
Author

aitseitz commented Jan 3, 2023

Monitor System Performance with SAR command

Manual:
https://linux.die.net/man/1/sar

Usage:
./sar_intervall.sh

Example Output:

cat sarstat-2022-07-20.out
Linux 4.18.0-240.15.1.el8_3.x86_64 (lvgawfam3102e) 	20.07.2022 	_x86_64_	(2 CPU)

10:28:53        CPU     %user     %nice   %system   %iowait    %steal     %idle
10:28:58        all      0,40      0,00      0,10      0,10      0,00     99,40
10:29:03        all      1,90      0,00      1,10      0,00      0,00     97,00
10:29:08        all      0,20      0,00      0,30      0,10      0,00     99,40

Durchschn.:     all      0,83      0,00      0,50      0,07      0,00     98,60

--> could help to find out that cpu pinning is not correctly configured for alfresco vms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment