Merge remote-tracking branch 'origin/develop' into 3079-Alertas_php7

This commit is contained in:
daniel 2018-11-15 15:34:08 +01:00
commit 7700ee85ca
1 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@
* @param string Snmp especific OID. * @param string Snmp especific OID.
*/ */
function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snmp_agent, $snmp_data, $snmp_type) { function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snmp_agent, $snmp_data, $snmp_type) {
global $config;
// Call snmptrap // Call snmptrap
if (empty($config['snmptrap'])) { if (empty($config['snmptrap'])) {
switch (PHP_OS) { 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'; $snmptrap_bin = '/usr/pkg/bin/snmptrap';
break; break;
default: default:
$snmptrap_bin = 'snmptrap'; $snmptrap_bin = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'
? 'C:\Windows\snmptrap.exe'
: 'snmptrap';
break; break;
} }
} }