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 <pr_id>`, i.e `./scripts/github-apply 5926`
This commit is contained in:
Tony Murray
2018-08-04 16:26:50 -05:00
committed by Neil Lathwood
parent e5fb7c9f16
commit d566544743

View File

@ -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";