Use full path to smartctl binary so system call works with sudo

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 12 years ago
parent 2d2bfe703c
commit 5229ca1e37
  1. 2
      zabbix_scripts/disco_smart_sudo

@ -27,7 +27,7 @@ foreach my $block (@blocks){
chomp($size);
next if ($size eq '0');
}
next unless (system("smartctl -A /dev/$block >/dev/null 2>&1") == 0);
next unless (system("/usr/sbin/smartctl -A /dev/$block >/dev/null 2>&1") == 0);
push @{$json->{data}}, { "{#SMARTDRIVE}" => "/dev/$block" };
}
print to_json($json);

Loading…
Cancel
Save