#!/usr/bin/env php '.1.3.6.1.4.1.12356.101.9.2.1.1.1.1', 'ips_blocked' => '.1.3.6.1.4.1.12356.101.9.2.1.1.2.1', 'ips_crit' => '.1.3.6.1.4.1.12356.101.9.2.1.1.3.1', 'ips_high' => '.1.3.6.1.4.1.12356.101.9.2.1.1.4.1', 'ips_ano' => '.1.3.6.1.4.1.12356.101.9.2.1.1.9.1' ]; $result = ''; foreach ($oids as $name => $oid) { $x = cacti_snmp_get($host['hostname'], $host['snmp_community'], $oid, $host['snmp_version'], $host['snmp_username'], $host['snmp_password'], $host['snmp_auth_protocol'], $host['snmp_priv_passphrase'], $host['snmp_priv_protocol'], $host['snmp_context'], $host['snmp_port'], $host['snmp_timeout'], $host['snmp_retries'], SNMP_POLLER, $host['snmp_engine_id']); if (is_numeric($x)) { $result .= $name . ':' . $x . ' '; } else { $result .= $name . ':0 '; } } return $result; }