<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */

// RAPID PSU states (Avaya models VSP8284 and VSP7254)
$oids = snmpwalk_cache_oid($device, 'rcChasPowerSupplyOperStatus', array(), 'RAPID-CITY');

foreach ($oids as $index => $entry)
{
  $descr = "Power Supply $index";
  $oid   = ".1.3.6.1.4.1.2272.1.4.8.1.1.2.$index";
  $value = $entry['rcChasPowerSupplyOperStatus'];
  discover_sensor($valid['sensor'], 'state', $device, $oid, 'supply-'.$index, 'RapidPSUOperState', $descr, NULL, $value, array('entPhysicalClass' => 'powersupply'));
}

// RAPID FAN states (Avaya models VSP8284 and VSP7254)
$oids = snmpwalk_cache_oid($device, 'rcChasFanOperStatus', array(), 'RAPID-CITY');

foreach ($oids as $index => $entry)
{
  $descr = "Chassis FAN $index";
  $oid   = ".1.3.6.1.4.1.2272.1.4.7.1.1.2.$index";
  $value = $entry['rcChasFanOperStatus'];
  discover_sensor($valid['sensor'], 'state', $device, $oid, 'fan-'.$index, 'RapidFANOperState', $descr, NULL, $value, array('entPhysicalClass' => 'fan'));
}

// EOF


