From 5229ca1e375f26774c80ab78b8cda819bc8cb62b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 22 Apr 2013 19:20:35 +0200 Subject: [PATCH] Use full path to smartctl binary so system call works with sudo --- zabbix_scripts/disco_smart_sudo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zabbix_scripts/disco_smart_sudo b/zabbix_scripts/disco_smart_sudo index ce3f861..c139bf1 100644 --- a/zabbix_scripts/disco_smart_sudo +++ b/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);