newdevice: Added support for Digipower PDU (#6014)

This commit is contained in:
VVelox 2017-03-03 08:26:21 -06:00 committed by Neil Lathwood
parent 0cafdd39b6
commit 57f27fbad2
7 changed files with 41 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,7 @@
os: digipower
text: 'Digipower'
type: power
over:
- { graph: device_current, text: Current }
discovery:
- sysObjectId: .1.3.6.1.4.1.17420

View File

@ -0,0 +1,15 @@
<?php
// input current
$oids = snmp_get($device, '.1.3.6.1.4.1.17420.1.2.9.1.11.0', '-OsqnU');
d_echo($oids."\n");
if ($oids) {
echo ' Cyberpower Input Current';
list($oid, $current) = explode(' ', $oids);
$divisor = 10;
$type = 'digipower';
$descr = 'Input';
$current=$current/10;
discover_sensor($valid['sensor'], 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
}

View File

@ -0,0 +1,12 @@
<?php
$oids=array(
'.1.3.6.1.4.1.17420.1.2.9.1.19.0',
'.1.3.6.1.4.1.17420.1.2.4.0'
);
$returned_oids=snmp_get_multi_oid($device, $oids);
$hardware = $returned_oids['.1.3.6.1.4.1.17420.1.2.9.1.19.0'];
$hardware = str_replace('"', '', $hardware);
$version = $returned_oids['.1.3.6.1.4.1.17420.1.2.4.0'];
$version = str_replace('"', '', $version);

View File

@ -1759,4 +1759,9 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('zyxelnwa');
$this->checkOS('zyxelnwa', 'zyxelnwa1');
}
public function testDigipower()
{
$this->checkOS('digipower');
}
}

View File

@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Switched PDU
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.17420