Module: check_mk
Branch: master
Commit: 2e235ecd5e9083772c80349197a859a544aba434
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e235ecd5e9083…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 14:15:29 2014 +0100
#1747 FIX zfsget: try to speed up agent code for Linux/Solaris/FreeBSD by using -t
filesystem,volume
This removes snapshots from the list and thus greatly reduces the run time and output
size.
The option <tt>-t</tt> is not always available, however, so if the command
fails with
the option <tt>-t</tt> it is retried afterwards without.
---
.werks/1747 | 11 +++++++++++
ChangeLog | 1 +
agents/check_mk_agent.freebsd | 3 ++-
agents/check_mk_agent.linux | 3 ++-
agents/check_mk_agent.solaris | 3 ++-
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/1747 b/.werks/1747
new file mode 100644
index 0000000..dd9db86
--- /dev/null
+++ b/.werks/1747
@@ -0,0 +1,11 @@
+Title: zfsget: try to speed up agent code for Linux/Solaris/FreeBSD by using -t
filesystem,volume
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418130856
+Class: fix
+
+This removes snapshots from the list and thus greatly reduces the run time and output
size.
+The option <tt>-t</tt> is not always available, however, so if the command
fails with
+the option <tt>-t</tt> it is retried afterwards without.
diff --git a/ChangeLog b/ChangeLog
index bc1ca88..1b8acf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -149,6 +149,7 @@
* 1731 FIX: ipmi_sensors: Fixed agent part when ipmi-sensors call on first agent
run...
* 1732 FIX: dell_powerconnect_cpu: Fixed exception during inventory for incompatible
devices
* 1733 FIX: dell_powerconnect_psu: Skipping inventory of not supported System temp
sesnor for M6220 devices...
+ * 1747 FIX: zfsget: try to speed up agent code for Linux/Solaris/FreeBSD by using -t
filesystem,volume...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index 0862727..008d613 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -130,7 +130,8 @@ fi
# Filesystem usage for ZFS
if type zfs > /dev/null 2>&1 ; then
echo '<<<zfsget>>>'
- zfs get -Hp name,quota,used,avail,mountpoint,type
+ zfs get -Hp name,quota,used,avail,mountpoint,type -t filesystem,volume || \
+ zfs get -Hp name,quota,used,avail,mountpoint,type
echo '[df]'
df -kP -t zfs | sed 1d
fi
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index a32122f..a476f0c 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -146,7 +146,8 @@ echo '[df_inodes_end]'
# Filesystem usage for ZFS
if type zfs > /dev/null 2>&1 ; then
echo '<<<zfsget>>>'
- zfs get -Hp name,quota,used,avail,mountpoint,type
+ zfs get -Hp name,quota,used,avail,mountpoint,type -t filesystem,volume || \
+ zfs get -Hp name,quota,used,avail,mountpoint,type
echo '[df]'
df -PTlk -t zfs | sed 1d
fi
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 7f999e0..18842fb 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -150,7 +150,8 @@ if type zfs &>/dev/null
then
echo '<<<zfsget>>>'
echo '[zfs]'
- zfs get -Hp name,quota,used,avail,mountpoint,type
+ zfs get -Hp name,quota,used,avail,mountpoint,type -t filesystem,volume || \
+ zfs get -Hp name,quota,used,avail,mountpoint,type
echo '[df]'
df -l -k -F zfs 2>/dev/null | sed 1d
fi