mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
newdevice: Added support for Digipower PDU (#6014)
This commit is contained in:
parent
0cafdd39b6
commit
57f27fbad2
BIN
html/images/logos/digipower.png
Normal file
BIN
html/images/logos/digipower.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
html/images/os/digipower.png
Normal file
BIN
html/images/os/digipower.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
7
includes/definitions/digipower.yaml
Normal file
7
includes/definitions/digipower.yaml
Normal 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
|
15
includes/discovery/sensors/current/digipower.inc.php
Normal file
15
includes/discovery/sensors/current/digipower.inc.php
Normal 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);
|
||||
}
|
12
includes/polling/os/digipower.inc.php
Normal file
12
includes/polling/os/digipower.inc.php
Normal 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);
|
@ -1759,4 +1759,9 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('zyxelnwa');
|
||||
$this->checkOS('zyxelnwa', 'zyxelnwa1');
|
||||
}
|
||||
|
||||
public function testDigipower()
|
||||
{
|
||||
$this->checkOS('digipower');
|
||||
}
|
||||
}
|
||||
|
2
tests/snmpsim/digipower.snmprec
Normal file
2
tests/snmpsim/digipower.snmprec
Normal 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
|
Loading…
Reference in New Issue
Block a user