mirror of
https://github.com/netweak/agent.git
synced 2025-01-20 22:42:36 -05:00
Revert MB conversion
This commit is contained in:
parent
0f7ce34dbe
commit
87a9707409
1 changed files with 9 additions and 9 deletions
18
agent.sh
18
agent.sh
|
@ -115,23 +115,23 @@ then
|
||||||
cpu_freq=$(prep $(num "$(lscpu | grep 'CPU MHz' | awk -F\: '{ print $2 }' | sed -e 's/^ *//g' -e 's/ *$//g')"))
|
cpu_freq=$(prep $(num "$(lscpu | grep 'CPU MHz' | awk -F\: '{ print $2 }' | sed -e 's/^ *//g' -e 's/ *$//g')"))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# RAM usage (in MB)
|
# RAM usage (in bytes)
|
||||||
ram_total=$(prep $(num "$(cat /proc/meminfo | grep ^MemTotal: | awk '{ print $2 }')"))
|
ram_total=$(prep $(num "$(cat /proc/meminfo | grep ^MemTotal: | awk '{ print $2 }')"))
|
||||||
ram_free=$(prep $(num "$(cat /proc/meminfo | grep ^MemFree: | awk '{ print $2 }')"))
|
ram_free=$(prep $(num "$(cat /proc/meminfo | grep ^MemFree: | awk '{ print $2 }')"))
|
||||||
ram_cached=$(prep $(num "$(cat /proc/meminfo | grep ^Cached: | awk '{ print $2 }')"))
|
ram_cached=$(prep $(num "$(cat /proc/meminfo | grep ^Cached: | awk '{ print $2 }')"))
|
||||||
ram_buffers=$(prep $(num "$(cat /proc/meminfo | grep ^Buffers: | awk '{ print $2 }')"))
|
ram_buffers=$(prep $(num "$(cat /proc/meminfo | grep ^Buffers: | awk '{ print $2 }')"))
|
||||||
ram_usage=$((($ram_total-($ram_free+$ram_cached+$ram_buffers)) / 1024))
|
ram_usage=$((($ram_total-($ram_free+$ram_cached+$ram_buffers)) * 1024))
|
||||||
ram_total=$(($ram_total / 1024))
|
ram_total=$(($ram_total * 1024))
|
||||||
|
|
||||||
# Swap usage (in MB)
|
# Swap usage (in bytes)
|
||||||
swap_total=$(prep $(num "$(cat /proc/meminfo | grep ^SwapTotal: | awk '{ print $2 }')"))
|
swap_total=$(prep $(num "$(cat /proc/meminfo | grep ^SwapTotal: | awk '{ print $2 }')"))
|
||||||
swap_free=$(prep $(num "$(cat /proc/meminfo | grep ^SwapFree: | awk '{ print $2 }')"))
|
swap_free=$(prep $(num "$(cat /proc/meminfo | grep ^SwapFree: | awk '{ print $2 }')"))
|
||||||
swap_usage=$((($swap_total-$swap_free) / 1024))
|
swap_usage=$((($swap_total-$swap_free) * 1024))
|
||||||
swap_total=$(($swap_total / 1024))
|
swap_total=$(($swap_total * 1024))
|
||||||
|
|
||||||
# Disk usage (in MB)
|
# Disk usage (in bytes)
|
||||||
disk_total=$(prep $(num "$(($(df -P -B 1M | grep '^/' | awk '{ print $2 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
disk_total=$(prep $(num "$(($(df -P -B 1 | grep '^/' | awk '{ print $2 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
||||||
disk_usage=$(prep $(num "$(($(df -P -B 1M | grep '^/' | awk '{ print $3 }' | sed -e :a -e '$!N;s/\n/+/;ta')))"))
|
disk_usage=$(prep $(num "$(($(df -P -B 1 | grep '^/' | awk '{ print $3 }' | 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…
Add table
Reference in a new issue