Skip to content

Commit

Permalink
newdevice: Added support for Digipower PDU (#6014)
Browse files Browse the repository at this point in the history
  • Loading branch information
VVelox authored and laf committed Mar 3, 2017
1 parent 0cafdd3 commit 57f27fb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
Binary file added html/images/logos/digipower.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/os/digipower.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions includes/definitions/digipower.yaml
@@ -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
15 changes: 15 additions & 0 deletions includes/discovery/sensors/current/digipower.inc.php
@@ -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);
}
12 changes: 12 additions & 0 deletions includes/polling/os/digipower.inc.php
@@ -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);
5 changes: 5 additions & 0 deletions tests/OSDiscoveryTest.php
Expand Up @@ -1759,4 +1759,9 @@ public function testZyxelnwa()
$this->checkOS('zyxelnwa');
$this->checkOS('zyxelnwa', 'zyxelnwa1');
}

public function testDigipower()
{
$this->checkOS('digipower');
}
}
2 changes: 2 additions & 0 deletions tests/snmpsim/digipower.snmprec
@@ -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

0 comments on commit 57f27fb

Please sign in to comment.