@@ 45-49 (lines=5) @@ | ||
42 | switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) { |
|
43 | case 'command': |
|
44 | if (defined('PSI_UPS_SNMPUPS_LIST') && is_string(PSI_UPS_SNMPUPS_LIST)) { |
|
45 | if (preg_match(ARRAY_EXP, PSI_UPS_SNMPUPS_LIST)) { |
|
46 | $upss = eval(PSI_UPS_SNMPUPS_LIST); |
|
47 | } else { |
|
48 | $upss = array(PSI_UPS_SNMPUPS_LIST); |
|
49 | } |
|
50 | foreach ($upss as $ups) { |
|
51 | CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -r 1 ".$ups." .1.3.6.1.4.1.318.1.1.1.1", $buffer, PSI_DEBUG); |
|
52 | if (strlen($buffer) > 0) { |
|
@@ 81-85 (lines=5) @@ | ||
78 | snmp_set_valueretrieval(SNMP_VALUE_LIBRARY); |
|
79 | snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC); |
|
80 | if (defined('PSI_UPS_SNMPUPS_LIST') && is_string(PSI_UPS_SNMPUPS_LIST)) { |
|
81 | if (preg_match(ARRAY_EXP, PSI_UPS_SNMPUPS_LIST)) { |
|
82 | $upss = eval(PSI_UPS_SNMPUPS_LIST); |
|
83 | } else { |
|
84 | $upss = array(PSI_UPS_SNMPUPS_LIST); |
|
85 | } |
|
86 | foreach ($upss as $ups) { |
|
87 | if (! PSI_DEBUG) { |
|
88 | restore_error_handler(); /* default error handler */ |