Module: check_mk
Branch: master
Commit: c159869ab79c632096530ba217ede8de87452279
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c159869ab79c63…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 29 11:22:19 2015 +0200
#2358 FIX check_mk_agent.solaris: more correct computation of zfs used space
Thanks to Michel Müller.
---
.werks/2358 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 7 ++++---
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/2358 b/.werks/2358
new file mode 100644
index 0000000..6a541f9
--- /dev/null
+++ b/.werks/2358
@@ -0,0 +1,9 @@
+Title: check_mk_agent.solaris: more correct computation of zfs used space
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1435569680
+Class: fix
+
+Thanks to Michel Müller.
diff --git a/ChangeLog b/ChangeLog
index 5552d05..ac147ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 1260 jolokia_metrics.perm_gen: New Check to monitor used Perm Space on a JVM
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
+ * 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
Multisite:
* 2314 FIX: Availability: fixed exception when grouping by host or service group
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 868e917..06c9b7b 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -149,9 +149,10 @@ done
if type zfs &>/dev/null
then
echo '<<<zfsget>>>'
- echo '[zfs]'
- zfs get -Hp name,quota,used,avail,mountpoint,type -t filesystem,volume || \
- zfs get -Hp name,quota,used,avail,mountpoint,type
+ zfs get -Hp name,usedbydataset,avail,mountpoint,type | sed
's/usedbydataset/used/g' 2>/dev/null
+ if [ $? -ne 0 ] ; then
+ zfs get -Hp name,referenced,avail,mountpoint,type | sed
's/referenced/used/g'
+ fi
echo '[df]'
df -l -k -F zfs 2>/dev/null | sed 1d
fi