From b786c6c3ab05360fcdde070d0b4cde07763d049a Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 15 Nov 2018 13:04:35 +0100 Subject: [PATCH] Fixed snmptrap binary in windows trap generator --- pandora_console/include/functions_snmp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_snmp.php b/pandora_console/include/functions_snmp.php index fe5333f162..769524744c 100644 --- a/pandora_console/include/functions_snmp.php +++ b/pandora_console/include/functions_snmp.php @@ -25,6 +25,7 @@ * @param string Snmp especific OID. */ function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snmp_agent, $snmp_data, $snmp_type) { + global $config; // Call snmptrap if (empty($config['snmptrap'])) { switch (PHP_OS) { @@ -35,7 +36,9 @@ function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snm $snmptrap_bin = '/usr/pkg/bin/snmptrap'; break; default: - $snmptrap_bin = 'snmptrap'; + $snmptrap_bin = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' + ? 'C:\Windows\snmptrap.exe' + : 'snmptrap'; break; } }