Observium_CE/includes/polling/ports/smon-mib.inc.php

29 lines
684 B
PHP

<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
// SMON-MIB
// Get monitoring ([e|r]span) ports
$smon_statuses = snmpwalk_cache_oid($device, "portCopyStatus", [], "SMON-MIB");
foreach ($smon_statuses as $smon_index => $smon) {
[, $smon_index] = explode('.', $smon_index); // ifIndex
if ($smon['portCopyStatus'] == 'active' && isset($port_stats[$smon_index])) {
// rewrite the ifOperStatus (for active monitoring destinations)
$port_stats[$smon_index]['ifOperStatus'] = 'monitoring';
}
}
unset($smon, $smon_statuses, $smon_index);
// EOF