'.1.3.6.1.4.1.6876.2.1.1.2', 'vh_state' => '.1.3.6.1.4.1.6876.2.1.1.6', 'vh_tools' => '.1.3.6.1.4.1.6876.2.1.1.4' ]; $vh_tools_run = 0; $vh_state = 0; $vh_tools_ninst = 0; $vh_tools_run = 0; $vh_tools_nrun = 0; $array = cacti_snmp_walk($hostname, $community, $oids['vh_state'], 1, '', '', '', '', '', '', $port, $timeout, 2, 20, SNMP_POLLER); $vhosts = cacti_count($array); $array = cacti_snmp_walk($hostname, $community, $oids['vh_state'], 1, '','', '','', '', '', $port, $timeout, 2, 20, SNMP_POLLER); if (cacti_sizeof($array)) { foreach ($array as $key => $value) { if (cacti_strtolower(trim($value['value'])) == 'powered on' || cacti_strtolower(trim($value['value'])) == 'poweredon') { $vh_state++; } } } $array = cacti_snmp_walk($hostname, $community, $oids['vh_tools'], 1, '', '', '', '', '', '', $port, $timeout, 2, 20, SNMP_POLLER); if (cacti_sizeof($array)) { foreach ($array as $key => $value) { if (str_contains($value['value'], 'not installed')) { $vh_tools_ninst++; } elseif (str_contains($value['value'], 'not running')) { $vh_tools_nrun++; } else { $vh_tools_run++; } } } return ("vh:$vhosts vh_state:$vh_state tools_run:$vh_tools_run tools_nrun:$vh_tools_nrun tools_ninst:$vh_tools_ninst\n"); }