Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / zfs / zfsarcstats-counters @ db27ad45

Historique | Voir | Annoter | Télécharger (1,09 ko)

1 4578640c Alex Trull
#!/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 65652aa0 dipohl
graph_category fs
17 4578640c Alex Trull
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 e4cd049b Lars Kruse
	    exit 0
27 4578640c Alex Trull
	fi
28
	ostype=`uname -s`
29
	if [ ${ostype} = "FreeBSD" ]; then
30
	    echo "yes"
31 e4cd049b Lars Kruse
	else
32
	    echo "no (Your OS is not supported by this plugin)"
33 4578640c Alex Trull
	fi
34 e4cd049b Lars Kruse
	exit 0
35 4578640c Alex Trull
	;;
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 "^\."