add space to grep to get only local disks
This commit is contained in:
parent
0402a15828
commit
0395efbb0f
1 changed files with 2 additions and 2 deletions
4
agent.sh
4
agent.sh
|
@ -130,8 +130,8 @@ swap_usage=$((($swap_total-$swap_free) * 1024))
|
||||||
swap_total=$(($swap_total * 1024))
|
swap_total=$(($swap_total * 1024))
|
||||||
|
|
||||||
# Disk usage (in bytes)
|
# Disk usage (in bytes)
|
||||||
disk_total=$(prep $(num "$(($(df --output=size,source -B 1 | grep '/' | awk '{ print $1 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
disk_total=$(prep $(num "$(($(df --output=size,source -B 1 | grep ' /' | awk '{ print $1 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
||||||
disk_usage=$(prep $(num "$(($(df --output=used,source -B 1 | grep '/' | awk '{ print $1 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
disk_usage=$(prep $(num "$(($(df --output=used,source -B 1 | grep ' /' | awk '{ print $1 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
||||||
|
|
||||||
# Disk array
|
# Disk array
|
||||||
disk_array=$(prep "$(df -P -B 1 | grep '^/' | awk '{ print $1" "$2" "$3";" }' | sed -e :a -e '$!N;s/\n/ /;ta' | awk '{ print $0 } END { if (!NR) print "N/A" }')")
|
disk_array=$(prep "$(df -P -B 1 | grep '^/' | awk '{ print $1" "$2" "$3";" }' | sed -e :a -e '$!N;s/\n/ /;ta' | awk '{ print $0 } END { if (!NR) print "N/A" }')")
|
||||||
|
|
Loading…
Reference in a new issue