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
This commit is contained in:
Mathieu Arnold 2016-08-04 14:26:56 +00:00
parent ee4b91558f
commit b224fa620b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=419615
5 changed files with 95 additions and 1 deletions

View file

@ -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}')

View file

@ -3,7 +3,7 @@
PORTNAME= munin
PORTVERSION= ${MUNIN_VERSION}
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= sysutils perl5
MASTER_SITES= ${MUNIN_SITES}
PKGNAMESUFFIX= -node

View file

@ -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

View file

@ -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

View file

@ -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