From 2a0c6b2ad950f4b97bb39c234d6a00937e15c025 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 20 Sep 2019 12:54:01 +0200 Subject: [PATCH] Remove trailing x for compressratio with ZoL < 0.8 --- zabbix_scripts/check_zfs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zabbix_scripts/check_zfs b/zabbix_scripts/check_zfs index 8183af7..6e7b2df 100644 --- a/zabbix_scripts/check_zfs +++ b/zabbix_scripts/check_zfs @@ -63,6 +63,10 @@ if ($pool){ chomp; my @parse = split /\t+/, $_; $json->{$parse[1]} = (defined $map->{$parse[2]}) ? $map->{$parse[2]} : $parse[2]; + if ($parse[1] =~ m/compressratio$/){ + # Remove trailing x for compressratio and refcompressratio as before 0.8.0 it can be like 1.23x + $json->{$parse[1]} =~ s/x$//; + } } } elsif ($sanoidsnap){ print qx($sanoid --monitor-snapshot);