diff --git a/LibreNMS/Config.php b/LibreNMS/Config.php index 1b1fe6046c..d057767deb 100644 --- a/LibreNMS/Config.php +++ b/LibreNMS/Config.php @@ -535,13 +535,10 @@ class Config public static function locateBinary($binary) { if (!str_contains($binary, '/')) { - $output = `whereis -b $binary`; - $list = trim(substr($output, strpos($output, ':') + 1)); - $targets = explode(' ', $list); - foreach ($targets as $target) { - if (is_executable($target)) { - return $target; - } + $target = trim(`which $binary`); + + if (!empty($target)) { + return $target; } } return $binary;