2015-07-20 10:46:35 +02:00
< ? php
2015-07-20 11:55:36 +02:00
if ( $device [ 'os' ] == 'xos' ) {
2016-04-21 14:24:53 -07:00
echo ( " EXTREME-BASE-MIB " );
2015-07-20 11:55:36 +02:00
// Power Usage
$descr = " Power Usage " ;
$oid = " 1.3.6.1.4.1.1916.1.1.1.40.1.0 " ; // extremeSystemPowerUsage
$value = snmp_get ( $device , $oid , '-Oqv' , 'EXTREME-BASE-MIB' );
$divisor = " 1000 " ;
2015-07-20 10:46:35 +02:00
2015-07-20 11:55:36 +02:00
if ( is_numeric ( $value )) {
2015-07-21 13:03:32 +02:00
$value = ( $value / $divisor ); // Nasty hack to divide the first value by 1000 since the divisor only works for polling after the sensor has been added
2015-07-20 11:55:36 +02:00
discover_sensor ( $valid [ 'sensor' ], 'power' , $device , $oid , '1' , 'extreme-power' , $descr , $divisor , 1 , null , null , null , null , $value ); // No limits have been specified since all equipment is different and will use different amount of Watts
}
2015-07-20 10:46:35 +02:00
}
// EOF