-
Notifications
You must be signed in to change notification settings - Fork 0
/
atop_notes.txt
56 lines (38 loc) · 1.9 KB
/
atop_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Appears atop -b switch behavior is to begin at the minute, ignore the seconds, and if -e isn't given just go to the end
Edit the file /usr/share/atop/atop.daily
INTERVAl=5
LOGPATH="/var/tmp/atop.red"
Restart the atop service systemctl restart atop.service
in /usr/share/atop
backup atop.daily
replace it with:
#!/bin/bash
exec atop -w /var/tmp/atop.red 5
save it
sudo systemctl restart atop
atop -w /var/tmp/atop.raw 5 60 #REQUIRED format is: "every 5 seconds for a total of 60"
myvar=$(date +"%T"); atop -w /var/tmp/atop.raw 5 60
#Basically we can "time atop" to figure out the pattern before we convert it, and it looks like this: total_time = $interval_in_secs * $times - $interval_in_secs ))
interval_in_secs=5
total_time=60
times=$(calc \($total_time+$interval_in_secs\)/$interval_in_secs)
echo $interval_in_secs, $times
time sh -c "atop -w /var/tmp/atop.raw $interval_in_secs $times"
intervalsec=5
totaltime=12 #will be in mins if interval is > 60 lets say, and in seconds if < 60
my_i=$(calc $totaltimemins/$interval)
my_t=$(calc $totaltimemins*$interval) #spaces bad for calc
echo $my_i, $my_t
time sh -c "atop -w /var/tmp/atop.raw $my_i $my_t"
myintervalsecs=5
mytotalmins=5
(( myrepeats= 60 / $myintervalsecs*$mytotalmins ))
atop -w /var/tmp/atop.raw $myintervalsecs $myrepeats
atop -PPRG -r /var/tmp/atop.raw #REQUIRED there are other -P combinations in the man... The ones that start with "For every process one line is shown." seem the most promising.
clear && atop -PPRC -r /var/tmp/atop.raw -b $(date +"%T") && atop -PPRM -r /var/tmp/atop.raw -b $(date +"%T")
Sadly it prints out the whole last minute up until now. So, not only do we have to pick out columns and rows for processes, we have to seek the times right before EOF.
There's also 'atopsar' but it seems to return only the top 3 processes for CPU, RAM, DISK, etc.
nmon
xtop
collectl
research giving up time in loops to the os for different langs