mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Add support for ZFS On Linux
This commit is contained in:
parent
84d972d71f
commit
1bf1090901
1 changed files with 34 additions and 18 deletions
|
@ -6,6 +6,8 @@
|
|||
#%# capabilities=autoconf
|
||||
|
||||
sysctl='/sbin/sysctl'
|
||||
ostype=`uname -s`
|
||||
procfile='/proc/spl/kstat/zfs/arcstats'
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
|
@ -216,11 +218,18 @@ EOF
|
|||
echo "no (${sysctl} is not executable)"
|
||||
exit 1
|
||||
fi
|
||||
ostype=`uname -s`
|
||||
if [ ${ostype} = "FreeBSD" ]; then
|
||||
echo "yes"
|
||||
exit 0
|
||||
fi
|
||||
if [ ${ostype} = "Linux" ]; then
|
||||
if [ -f ${procfile} ]; then
|
||||
echo "yes"
|
||||
exit 0
|
||||
fi
|
||||
echo "no (The statsfile does not exist: ${procfile})"
|
||||
exit 1
|
||||
fi
|
||||
echo "no (You're OS is not supported by this plugin)"
|
||||
exit 1
|
||||
;;
|
||||
|
@ -228,4 +237,11 @@ EOF
|
|||
exit 0
|
||||
;;
|
||||
esac
|
||||
case ${ostype} in
|
||||
"FreeBSD")
|
||||
$sysctl kstat.zfs.misc.arcstats | sed -e 's/^kstat.zfs.misc.arcstats.//' -e 's/:/.value/'
|
||||
;;
|
||||
"Linux")
|
||||
cat ${procfile} | tail -n +3 | sed -e 's/ \+/ /g' | cut -f 1,3 -d ' ' | sed -e 's/ /.value /'
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue