diff options
author | mat <mat@FreeBSD.org> | 2016-08-04 22:26:56 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2016-08-04 22:26:56 +0800 |
commit | 8ce24fb3af5995fc345400cd5e820142c2e011c0 (patch) | |
tree | fcaa476454ef3c80c30540ad86183ebb9972c1f4 /sysutils | |
parent | 8586cb0a1443771755c45cf7049bd174516fc22e (diff) | |
download | freebsd-ports-gnome-8ce24fb3af5995fc345400cd5e820142c2e011c0.tar.gz freebsd-ports-gnome-8ce24fb3af5995fc345400cd5e820142c2e011c0.tar.zst freebsd-ports-gnome-8ce24fb3af5995fc345400cd5e820142c2e011c0.zip |
Fix swap accounting if there are multiple devices [1]
Add a few zfs related plugins [2]
PR: 210494 [1]
Submitted by: bcr [2]
Reported by: Fabian Keil [1]
Sponsored by: Absolight
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/munin-common/files/patch-plugins_node.d.freebsd_memory.in | 8 | ||||
-rw-r--r-- | sysutils/munin-node/Makefile | 2 | ||||
-rw-r--r-- | sysutils/munin-node/plugins/zfs_compress | 27 | ||||
-rw-r--r-- | sysutils/munin-node/plugins/zpool_chksum | 34 | ||||
-rw-r--r-- | sysutils/munin-node/plugins/zpool_dedup | 25 |
5 files changed, 95 insertions, 1 deletions
diff --git a/sysutils/munin-common/files/patch-plugins_node.d.freebsd_memory.in b/sysutils/munin-common/files/patch-plugins_node.d.freebsd_memory.in new file mode 100644 index 000000000000..6646d436d225 --- /dev/null +++ b/sysutils/munin-common/files/patch-plugins_node.d.freebsd_memory.in @@ -0,0 +1,8 @@ +--- plugins/node.d.freebsd/memory.in.orig 2014-11-24 21:46:24 UTC ++++ plugins/node.d.freebsd/memory.in +@@ -74,4 +74,4 @@ echo wired.value $(($WIRED_COUNT*$PAGESI + echo buffers.value $(($BUFFERS_COUNT)) + echo cached.value $(($CACHE_COUNT*$PAGESIZE)) + echo free.value $(($FREE_COUNT*$PAGESIZE)) +-echo swap.value $(swapinfo -k | awk '{sum += $3}; END {print sum * 1024}') ++echo swap.value $(swapinfo -k | awk '!/^Total/ && !/^Device/ {sum += $3}; END {print sum * 1024}') 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 + |