mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-02-28 13:59:12 -05:00
15 lines
267 B
Bash
15 lines
267 B
Bash
#!/bin/sh
|
|
|
|
if is_osx; then
|
|
collect () {
|
|
report $(sysctl -n vm.swapusage | awk '{printf "%.1f", $6 / $3 * 100.0}')
|
|
}
|
|
else
|
|
collect () {
|
|
report $(free | awk '/Swap/{printf "%.1f", $3/$2 * 100.0}')
|
|
}
|
|
fi
|
|
|
|
docs () {
|
|
echo "Percentage of used swap space."
|
|
} |