From d566544743253b126464248e370f13aea3db4ab9 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 4 Aug 2018 16:26:50 -0500 Subject: [PATCH] Find snmpsimd binary rather than infer snmpsimd.py (#8952) instead of calling snmpsimd.py blindly DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply `, i.e `./scripts/github-apply 5926` --- LibreNMS/Util/Snmpsim.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LibreNMS/Util/Snmpsim.php b/LibreNMS/Util/Snmpsim.php index 9a19a1e1c4..5837bc59f9 100644 --- a/LibreNMS/Util/Snmpsim.php +++ b/LibreNMS/Util/Snmpsim.php @@ -151,7 +151,12 @@ class Snmpsim */ private function getCmd($with_log = true) { - $cmd = "snmpsimd.py --data-dir={$this->snmprec_dir} --agent-udpv4-endpoint={$this->ip}:{$this->port}"; + $cmd = Config::locateBinary('snmpsimd'); + if (!is_executable($cmd)) { + $cmd = Config::locateBinary('snmpsimd.py'); + } + + $cmd .= " --data-dir={$this->snmprec_dir} --agent-udpv4-endpoint={$this->ip}:{$this->port}"; if (is_null($this->log)) { $cmd .= " --logging-method=null";