-
-
Save tom-a/233b6de49f9d59235b95 to your computer and use it in GitHub Desktop.
FreeBSDでCPUクロックをモニタするmuninのplugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#%# family=auto | |
#%# capabilities=autoconf | |
GETNUM=`sysctl dev.cpu.0.freq | sed s/dev.cpu.0.freq..//` | |
GETNUM=`expr $GETNUM \* 1000000` | |
if [ "$1" = "autoconf" ]; then | |
if [ -n ${GETNUM} ] ; then | |
echo yes | |
exit 0 | |
else | |
echo no | |
exit 0 | |
fi | |
fi | |
if [ "$1" = "config" ]; then | |
echo 'graph_title CPU Frequensy' | |
echo 'graph_args --lower-limit 0 --base 1000' | |
echo 'graph_vlabel Clock' | |
echo 'graph_category system' | |
echo 'CPU0.label CPU0' | |
echo 'CPU0.min 0' | |
echo 'CPU0.type GAUGE' | |
exit 0 | |
fi | |
echo "CPU0.value $GETNUM"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment