root / plugins / zfs / zfsarcstats-counters @ e5ce7492
Historique | Voir | Annoter | Télécharger (1,11 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
# ZFS ARC statistics for FreeBSD |
| 3 |
# Author alex@trull.org: |
| 4 |
# |
| 5 |
#%# family=auto |
| 6 |
#%# capabilities=autoconf |
| 7 |
|
| 8 |
sysctl='/sbin/sysctl' |
| 9 |
|
| 10 |
case $1 in |
| 11 |
config) |
| 12 |
cat <<EOF |
| 13 |
graph_title ZFS ARC Counters |
| 14 |
graph_vlabel per second |
| 15 |
graph_scale no |
| 16 |
graph_category filesystem |
| 17 |
graph_args -l 0 |
| 18 |
graph_info FreeBSD ZFS ARC Utilisation - Counters |
| 19 |
EOF |
| 20 |
$sysctl kstat.zfs.misc.arcstats.hits kstat.zfs.misc.arcstats | awk '/hits/ || /miss/ || /hash/ || /deleted/ || /evict/ { { FS = "[.:]" } { displayname = $5; gsub("_"," ",displayname) } {print $5".label "displayname"\n"$5".type DERIVE\n"$5".min 0"} }' | grep -v "^\."
|
| 21 |
exit 0 |
| 22 |
;; |
| 23 |
autoconf) |
| 24 |
if [ ! -x ${sysctl} ]; then
|
| 25 |
echo "no (${sysctl} is not executable)"
|
| 26 |
exit 1 |
| 27 |
fi |
| 28 |
ostype=`uname -s` |
| 29 |
if [ ${ostype} = "FreeBSD" ]; then
|
| 30 |
echo "yes" |
| 31 |
exit 0 |
| 32 |
fi |
| 33 |
echo "no (You're OS is not supported by this plugin)" |
| 34 |
exit 1 |
| 35 |
;; |
| 36 |
suggest) |
| 37 |
exit 0 |
| 38 |
;; |
| 39 |
esac |
| 40 |
|
| 41 |
$sysctl kstat.zfs.misc.arcstats.hits kstat.zfs.misc.arcstats | awk '/hits/ || /miss/ || /hash/ || /deleted/ || /evict/ { { FS = "[.:]" } { displayname = $5; gsub("_"," ",displayname) } {print $5".value",$NF} }' | grep -v "^\."
|
| 42 |
|
