newdevice: Added support for Cyberpower PDU (#6013)

This commit is contained in:
VVelox 2017-03-03 12:40:33 -06:00 committed by Neil Lathwood
parent 296360b204
commit 5805a55483
8 changed files with 69 additions and 5 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 618.50003 112.89725"><path d="M33.053 0C14.826 0 0 11.996 0 26.742v37.256c0 14.746 14.826 26.744 33.053 26.744 18.212 0 33.03-11.998 33.03-26.744v-2.182c0-1.164-.506-2.284-1.407-3.142-1.188-1.132-3.01-1.75-4.858-1.653-2.908.136-5.27 2.38-5.27 5.01v1.968c0 9.21-6.657 14.93-17.386 14.93-10.15 0-17.8-6.42-17.8-14.93V26.742c0-8.51 7.65-14.922 17.8-14.922 11.39 0 18.752 5.856 18.752 14.922v2.18c0 2.576 2.242 4.596 5.098 4.596 2.848 0 5.07-2.02 5.07-4.596v-2.18C66.082 11.996 51.265 0 33.052 0zm98.775 0c-6.103 0-9.744 3.484-9.744 9.318v76.715c0 3.172 1.89 5.145 4.937 5.145 1.724 0 2.923-.88 3.707-1.46l.437-.32c.094-.053 4.224-3.372 6.195-4.95 4.217 4.398 9.645 6.73 16.253 6.73 12.136 0 23.61-9.58 23.61-19.715v-17.1c0-10.14-11.474-19.717-23.61-19.717-5.23 0-9.605 1.978-12.183 3.485V9.32c0-6.434-4.822-9.318-9.602-9.318zm-18.652 34.867c-3.09 0-5.623 1.45-6.6 3.78.008-.034-8.318 18.5-8.318 18.5-.253.637-1.126 1.51-1.912 1.51-.354 0-.797 0-1.674-1.694-.012-.035-8.914-16.477-8.914-16.477-2.384-4.845-5.945-5.52-9.426-5.52-3.915 0-7.366 1.706-9.006 4.46-1.213 2.03-1.26 4.385-.142 6.45l13.046 22.41c4.39 7.568 5.608 13.773 3.73 18.974-2.03 5.63-7.744 10.11-17.464 13.7l-3.564 1.302c-2.91 1.02-4.436 3.673-3.698 6.422.96 3.496 5.516 4.87 8.996 3.92l-.013.008 3.28-.868c16.197-4.356 26.918-13.75 31.882-27.933l14.81-42.763c.445-1.467.17-3.004-.708-4.187-.966-1.282-2.49-1.993-4.306-1.993zm132.394.1c-3.235 0-4.677 2.414-4.677 4.818v42.85c0 4.475 4.37 8.107 9.742 8.107 5.372 0 9.734-3.632 9.734-8.107V54.11l2.577-2.07c2.35-1.877 6.005-2.958 10.024-2.958h5.198c4.55 0 8.387-3.206 8.387-6.994 0-3.798-3.838-7.006-8.387-7.006h-3.54c-4.302 0-9.603 2.66-13.84 6.928-.008 0-1.087 1.106-1.925 1.97l-8.935-7.142c-.862-.7-2.304-1.87-4.358-1.87zm-36.46.115c-13.405.122-27.274 7.36-27.274 19.28v17.1c0 11.528 15.165 19.28 29.328 19.28h7.14c4.664 0 6.323-2.312 6.323-4.478 0-2.155-1.66-4.473-6.324-4.473h-7.14c-6.414 0-11.212-5.453-11.212-10.327v-4.93c0-.303.002-1.017 1.763-1.017h25.762c5.408 0 9.48-2.992 9.48-6.98V54.25c0-4.268-1.676-8.19-4.855-11.344-5.025-4.972-13.62-7.905-22.99-7.824zm.02 10.932c6.584 0 8.34 3.723 8.34 5.933v1.428c0 .63-.172 1.668-1.372 1.668H203.09c-1.057 0-1.758-.633-1.758-1.223v-1.756c0-.058.08-6.05 7.8-6.05zm-59.757.873c5.583 0 8.488 4.92 8.488 9.775v14.8c0 4.623-5.503 7.466-9.452 7.466-2.212 0-9.445-.542-9.445-7.465v-17.1c0-6.504 6.518-7.476 10.41-7.476z" fill="#ed192d"/><path d="M291.816 14.02v75.2h23.364V61.93h11.716c7.247 0 14.685-1.1 20.516-5.817 5.572-4.49 8.322-11.285 8.322-18.406 0-8.126-4.18-15.566-11.18-19.738-6.483-3.728-14.7-3.95-22.044-3.95zm305.74 6.183v1.65h3.24v8.307h1.98v-8.306h3.257v-1.65zm10.16 0v9.957h1.83v-8.033l2.75 8.033h1.616l2.744-8.033v8.033h1.844v-9.957h-2.822l-2.567 7.117-2.542-7.117zM315.18 31.23h6.683c5.266 0 10.965.556 10.965 7.245 0 7.007-6.353 7.332-11.635 7.332h-6.013zm272.103.827c-7.587.084-11.268 5.36-13.012 12.673h-.206V33.207H555.54V89.22h21.712V64.89c0-3.297 0-6.91 1.525-9.648 1.746-3.178 5.364-3.836 8.873-3.836 1.42 0 2.847.217 4.176.54V32.345l-2.972-.235c-.542-.042-1.065-.06-1.57-.053zm-203.48.052c-17.56 0-30.82 11.618-30.82 29.6 0 16.99 13.71 28.6 30.82 28.6 17.097 0 30.79-11.61 30.79-28.6 0-17.982-13.276-29.6-30.79-29.6zm136.855 0c-7.98 0-16.533 2.745-22.228 8.652-5.27 5.382-8.227 13.602-8.227 21.168 0 7.997 3.192 15.672 9.227 21.04 6.342 5.594 14.342 7.34 22.574 7.34 13.26 0 25.3-6.242 28.717-19.832l-20.507-1.322c-.87 4.82-3.62 6.795-8.535 6.795-6.585 0-8.77-4.387-8.465-10.4h37.508v-2.954c0-18.424-11.406-30.487-30.062-30.487zm-109.465 1.097L429.29 89.22h15.558l7.554-30.372h.21l7.247 30.373h15.794l17.756-56.013h-15.248l-7.767 27.41-7.014-27.41h-16.24l-6.904 27.41h-.21l-7.25-27.41zM520.91 44.934c6.12 0 7.89 4.17 7.89 9.658h-15.68c-.212-5.156 2.082-9.658 7.79-9.658zm-137.107.873c7.424 0 7.556 9.754 7.556 15.132 0 15.01-3.617 16.12-7.557 16.12-3.95 0-7.582-1.11-7.582-16.12 0-5.38.114-15.133 7.583-15.133z" fill="#231f20"/></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.72188 78.129769"><path d="M56.896 53.224c0-1.002-.433-1.966-1.21-2.705-1.023-.975-2.59-1.508-4.182-1.424-2.504.116-4.538 2.05-4.538 4.312v1.694c0 7.93-5.73 12.856-14.97 12.856-8.737 0-15.325-5.528-15.325-12.856V23.024c0-7.327 6.59-12.848 15.327-12.848 9.808 0 16.146 5.042 16.146 12.848V24.9c0 2.22 1.93 3.96 4.388 3.96 2.453 0 4.366-1.74 4.366-3.96v-1.876C56.896 10.328 44.14 0 28.458 0 12.764 0 0 10.328 0 23.024v32.078C0 67.8 12.764 78.13 28.458 78.13c15.68 0 28.438-10.33 28.438-23.028v-1.878z" fill="#ed192d"/><path d="M94.182 33.25c5.28 0 11.634-.325 11.634-7.332 0-6.688-5.7-7.247-10.965-7.247h-6.683v14.58h6.015zm-6.015 43.415H64.804v-75.2h30.693c7.345 0 15.562.22 22.044 3.947 7.003 4.172 11.182 11.612 11.182 19.738 0 7.122-2.75 13.916-8.322 18.407-5.83 4.718-13.27 5.816-20.517 5.816H88.167v27.292" fill="#231f20"/></svg>

After

Width:  |  Height:  |  Size: 889 B

View File

@ -0,0 +1,13 @@
os: cyberpower
text: 'Cyberpower'
type: power
icon: cyberpower
over:
- { graph: device_current, text: Current }
- { graph: device_voltage, text: Voltage }
discovery:
- sysObjectId: .1.3.6.1.4.1.3808.1.1.3
poller_modules:
ports: 0
discovery_modules:
ports: 0

View File

@ -0,0 +1,15 @@
<?php
// input current
$oids = snmp_get($device, '.1.3.6.1.4.1.3808.1.1.3.2.3.1.1.2.1', '-OsqnU');
d_echo($oids."\n");
if ($oids) {
echo ' Cyberpower Input Current';
list($oid, $current) = explode(' ', $oids);
$divisor = 10;
$type = 'cyberpower';
$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,15 @@
<?php
// Input voltage
$oids = snmp_get($device, '.1.3.6.1.4.1.3808.1.1.3.2.3.1.1.6.1', '-OsqnU');
d_echo($oids."\n");
if ($oids) {
echo ' Cyberpower Input Voltage';
list($oid, $voltage) = explode(' ', $oids);
$divisor = 10;
$type = 'cyberpower';
$descr = 'Input';
$voltage=$voltage/10;
discover_sensor($valid['sensor'], 'voltage', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $voltage);
}

View File

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

View File

@ -482,6 +482,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('cyberoam-utm');
}
public function testCyberpower()
{
$this->checkOS('cyberpower');
}
public function testDasanNos()
{
$this->checkOS('dasan-nos');
@ -542,6 +547,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('developprinter');
}
public function testDigipower()
{
$this->checkOS('digipower');
}
public function testDlinkap()
{
$this->checkOS('dlinkap');
@ -1759,9 +1769,4 @@ 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|Power Manager
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.3808.1.1.3