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