aboutsummaryrefslogtreecommitdiff
path: root/sysutils/munin-node
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2016-08-04 14:26:56 +0000
committerMathieu Arnold <mat@FreeBSD.org>2016-08-04 14:26:56 +0000
commitb224fa620be7b2131272fa858ce66d54f99e84a9 (patch)
treefcaa476454ef3c80c30540ad86183ebb9972c1f4 /sysutils/munin-node
parentee4b91558f5f4ecb4b45f3902fc73fa48fd5365a (diff)
Notes
Diffstat (limited to 'sysutils/munin-node')
-rw-r--r--sysutils/munin-node/Makefile2
-rw-r--r--sysutils/munin-node/plugins/zfs_compress27
-rw-r--r--sysutils/munin-node/plugins/zpool_chksum34
-rw-r--r--sysutils/munin-node/plugins/zpool_dedup25
4 files changed, 87 insertions, 1 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile
index 4c2200eb5427..c8afffdd95a7 100644
--- a/sysutils/munin-node/Makefile
+++ b/sysutils/munin-node/Makefile
@@ -3,7 +3,7 @@
PORTNAME= munin
PORTVERSION= ${MUNIN_VERSION}
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= sysutils perl5
MASTER_SITES= ${MUNIN_SITES}
PKGNAMESUFFIX= -node
diff --git a/sysutils/munin-node/plugins/zfs_compress b/sysutils/munin-node/plugins/zfs_compress
new file mode 100644
index 000000000000..02f918f875d5
--- /dev/null
+++ b/sysutils/munin-node/plugins/zfs_compress
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+set -e
+set -u
+
+cat <<'EOM'
+graph_title ZFS dataset compression ratio
+graph_vlabel ratio
+graph_category ZFS
+graph_info This graph shows the ZFS dataset compression ratio
+EOM
+
+listing=$(zfs get -t filesystem -H compressratio)
+
+while read -r label _ ratio _; do
+ clean_label=$(echo "${label}" | sed -e 's|/|__|g')
+ echo "${clean_label}.label ${label}"
+ echo "${clean_label}.value ${ratio%x}"
+done <<eot
+${listing}
+eot
+
+exit 0
+
+
diff --git a/sysutils/munin-node/plugins/zpool_chksum b/sysutils/munin-node/plugins/zpool_chksum
new file mode 100644
index 000000000000..23a586919c67
--- /dev/null
+++ b/sysutils/munin-node/plugins/zpool_chksum
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+set -e
+set -u
+
+cat <<'EOM'
+graph_title ZFS dataset error counters
+graph_vlabel amount of errors
+graph_category ZFS
+graph_info This graph shows the ZFS dataset error counters for reads, writes, and checksums
+EOM
+
+status=$(zpool status|awk 'BEGIN {p=0} /spares$/ || /^$/ {p=0} p==1 {print} /NAME.*STATE.*READ/ {p=1}')
+
+while read -r label _ r w c; do
+ echo "R${label}.label READ ${label} "
+ echo "R${label}.value ${r}"
+ echo "R${label}.warning 1"
+ echo "R${label}.critical 2"
+ echo "W${label}.label WRITE ${label} "
+ echo "W${label}.value ${w}"
+ echo "W${label}.warning 1"
+ echo "W${label}.critical 2"
+ echo "C${label}.label CHKSUM ${label}"
+ echo "C${label}.value ${c}"
+ echo "C${label}.warning 1"
+ echo "C${label}.critical 2"
+done <<eot
+${status}
+eot
+
+exit 0
diff --git a/sysutils/munin-node/plugins/zpool_dedup b/sysutils/munin-node/plugins/zpool_dedup
new file mode 100644
index 000000000000..932b60628f5c
--- /dev/null
+++ b/sysutils/munin-node/plugins/zpool_dedup
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+set -e
+set -u
+
+cat <<'EOM'
+graph_title ZFS deduplication ratio
+graph_vlabel ratio
+graph_category ZFS
+graph_info This graph shows the ZFS pool deduplication ratio
+EOM
+
+listing=$(zpool get -H dedup)
+
+while read -r label _ ratio _; do
+ echo "${label}.label ${label}"
+ echo "${label}.value ${ratio%x}"
+done <<eot
+${listing}
+eot
+
+exit 0
+