Module: check_mk
Branch: master
Commit: b0072e51244d38293b47e2a4c2bb3406c2990d64
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b0072e51244d38…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Feb 25 11:05:08 2019 +0100
6762 FIX zfsget: Aligned behaviour in Solaris and Linux
Previously the implementation of getting zfs information was slightly
different in Linux and Solaris. Now both agents are fetching data only for
volumes and filesystems and are using the quota for computing the total size of
a filesystem or volume. So the information of each service will be more precise.
FEED-3375
Change-Id: I22d5f57c62a028af56b1bdf52b58e119b62f4588
---
.werks/6762 | 13 +++++++++++++
agents/check_mk_agent.linux | 3 +--
agents/check_mk_agent.solaris | 5 +----
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/.werks/6762 b/.werks/6762
new file mode 100644
index 0000000..1280d4b
--- /dev/null
+++ b/.werks/6762
@@ -0,0 +1,13 @@
+Title: zfsget: Fixed different behaviour of the plugin in Solaris and Linux
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1551088721
+Class: fix
+
+Previously the implementation of getting zfs information was slightly
+different in Linux and Solaris. Now both agents are fetching data only for
+volumes and filesystems and are using the quota for computing the total size of
+a filesystem or volume. So the information of each service will be more precise.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 8f1c447..6690f95 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -399,8 +399,7 @@ sections_systemd
# Filesystem usage for ZFS
if type zfs > /dev/null 2>&1 ; then
echo '<<<zfsget>>>'
- zfs get -Hp name,quota,used,avail,mountpoint,type -t filesystem,volume || \
- zfs get -Hp name,quota,used,avail,mountpoint,type
+ zfs get -t filesystem,volume -Hp name,quota,used,avail,mountpoint,type
2>/dev/null
echo '[df]'
df -PTlk -t zfs | sed 1d
fi
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 002afda..1c5bc66 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -199,10 +199,7 @@ done
if type zfs &>/dev/null
then
echo '<<<zfsget>>>'
- 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
+ zfs get -t filesystem,volume -Hp name,quota,used,avail,mountpoint,type
2>/dev/null
echo '[df]'
df -l -k -F zfs 2>/dev/null | sed 1d
fi