Check $sanoidmon is defined before checking its value

This commit is contained in:
Daniel Berteaud 2019-09-21 16:33:28 +02:00
parent 5493504e77
commit b5315cea86
1 changed files with 2 additions and 2 deletions

View File

@ -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';
}