From b5315cea860a3a7a99f61472e50603aebbbb6139 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sat, 21 Sep 2019 16:33:28 +0200 Subject: [PATCH] Check $sanoidmon is defined before checking its value --- zabbix_scripts/check_zfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zabbix_scripts/check_zfs b/zabbix_scripts/check_zfs index 071bfee..d333ff8 100644 --- a/zabbix_scripts/check_zfs +++ b/zabbix_scripts/check_zfs @@ -27,10 +27,10 @@ if (not $zpool or not $zfs){ print 'ZBX_NOTSUPPOTED'; exit 0; } -if ($sanoidmon and not $sanoid){ +if (defined $sanoidmon and not $sanoid){ die 'ZBX_NOTSUPPOTED'; } -if (not grep { $_ eq $sanoidmon } qw(snapshot capacity health)){ +if (defined $sanoidmon and not grep { $_ eq $sanoidmon } qw(snapshot capacity health)){ die 'ZBX_NOTSUPPOTED'; }