metrics.sh/metrics/cpu.sh

9 lines
153 B
Bash
Raw Normal View History

2015-02-19 14:15:38 -05:00
#!/bin/sh
2015-02-21 12:18:27 -05:00
collect () {
2015-03-15 05:14:19 -04:00
report $(ps axo %cpu | awk '{ sum+=$1 } END { printf "%.1f\n", sum }' | tail -n 1)
}
docs () {
echo "CPU load percentage."
2015-02-21 12:18:27 -05:00
}