Difference between revisions of "Read all sar collected files"

From wikieduonline
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* <code>[[for]] SA_FILE in $(ls -1 [[/var/log/sysstat/]]sa??); do sar -f $SA_FILE; done</code>
 
* <code>[[for]] SA_FILE in $(ls -1 [[/var/log/sysstat/]]sa??); do sar -f $SA_FILE; done</code>
 +
 +
 +
[[CPU]], print lines where <code>[[%idle]]</code> was under 10%:
 +
for SA_FILE in $(ls -1 /var/log/sysstat/sa??); do sar -f $SA_FILE | [[awk]] '$NF<10 {print}'; done
 +
 +
Memory, <code>[[kbavail]]</code>:
 +
for SA_FILE in $(ls -1 /var/log/sysstat/sa??); do sar -r -f $SA_FILE | [[awk]] '$3<1000 {print}'; done
  
  
  
  for SA_FILE in $(ls -1 /var/log/sysstat/sa??); do sar -f $SA_FILE | [[awk]] '$NF<10 {print}'; done
+
  00:00:01        CPU    %user    [[%nice]]   %system  %iowait    %steal    [[%idle]]
 +
 
  
 +
* [[Performance]]
 +
* [[sar -n ALL]]
 +
* [[nice]]
 +
* [[Memory]]: <code>[[sar -r]]</code>
 +
* [[journalctl -r grep oom]]
  
 +
== See also ==
 +
* {{sar}}
  
{{sar}}
+
[[Category:sar]]

Latest revision as of 06:15, 9 June 2024


CPU, print lines where %idle was under 10%:

for SA_FILE in $(ls -1 /var/log/sysstat/sa??); do sar -f $SA_FILE | awk '$NF<10 {print}'; done

Memory, kbavail:

for SA_FILE in $(ls -1 /var/log/sysstat/sa??); do sar -r -f $SA_FILE | awk '$3<1000 {print}'; done


00:00:01        CPU     %user     %nice   %system   %iowait    %steal     %idle


See also[edit]

Advertising: