#!/usr/bin/env php '.1.3.6.1.4.1.37447.1.3.4.0', 'iowritebytes' => '.1.3.6.1.4.1.37447.1.3.10.0', 'ioreads' => '.1.3.6.1.4.1.37447.1.3.2.0', 'ioreadbytes' => '.1.3.6.1.4.1.37447.1.3.8.0', 'ioreadhits' => '.1.3.6.1.4.1.37447.1.3.16.0' ]; $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; }