Added more statistics, renamed print_pidstat to print_stats
This commit is contained in:
parent
7c6742a1b2
commit
030f4f34f1
@ -76,17 +76,23 @@ print_psi () {
|
|||||||
cat "${(P)$(tr '[[:upper:]]' '[[:lower:]]' <<< "${psi_file}")}"
|
cat "${(P)$(tr '[[:upper:]]' '[[:lower:]]' <<< "${psi_file}")}"
|
||||||
}
|
}
|
||||||
|
|
||||||
print_pidstat () {
|
print_stats () {
|
||||||
local psi_type="${1}"
|
local psi_type="${1}"
|
||||||
|
|
||||||
case "${psi_type}" in
|
case "${psi_type}" in
|
||||||
CPU)
|
CPU)
|
||||||
|
top -bcn1 -o %CPU -w 512 | head -n 30
|
||||||
|
printf "\n\n"
|
||||||
pidstat -ul --human
|
pidstat -ul --human
|
||||||
;;
|
;;
|
||||||
IO)
|
IO)
|
||||||
|
sudo iotop --batch --only --iter=1
|
||||||
|
printf "\n\n"
|
||||||
pidstat -dl --human
|
pidstat -dl --human
|
||||||
;;
|
;;
|
||||||
MEM)
|
MEM)
|
||||||
|
top -bcn1 -o %MEM -w 512 | head -n 30
|
||||||
|
printf "\n\n"
|
||||||
pidstat -rl --human
|
pidstat -rl --human
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -181,8 +187,8 @@ send () {
|
|||||||
# is this an email or SMS?
|
# is this an email or SMS?
|
||||||
if [[ ! "${dst}" =~ "@${sms_domain}" ]]; then
|
if [[ ! "${dst}" =~ "@${sms_domain}" ]]; then
|
||||||
for p in $(tr '|' ' ' <<< "${current_alarms}"); do
|
for p in $(tr '|' ' ' <<< "${current_alarms}"); do
|
||||||
printf "\npidstat info for ${p}\n\n" >> ${email}
|
printf "\nStatistics info for ${p}\n\n" >> ${email}
|
||||||
print_pidstat "${p}" >> ${email}
|
print_stats "${p}" >> ${email}
|
||||||
printf "\n\n" >> ${email}
|
printf "\n\n" >> ${email}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user