mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Basic Dell UPS Support #5258
This commit is contained in:
committed by
Neil Lathwood
parent
1f7c462941
commit
28dff189c7
8
includes/definitions/dell-ups.yaml
Normal file
8
includes/definitions/dell-ups.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
os: dell-ups
|
||||||
|
text: 'Dell UPS'
|
||||||
|
type: power
|
||||||
|
icon: dell
|
||||||
|
over:
|
||||||
|
- { graph: device_current, text: Current }
|
||||||
|
mib_dir:
|
||||||
|
- dell
|
||||||
21
includes/discovery/os/dell-ups.inc.php
Normal file
21
includes/discovery/os/dell-ups.inc.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* LibreNMS
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version. Please see LICENSE.txt at the top level of
|
||||||
|
* the source code distribution for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$dellups = array(
|
||||||
|
'.1.3.6.1.4.1.674.10902.2'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (starts_with($sysObjectId, $dellups)) {
|
||||||
|
$os = 'dell-ups';
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($dellups);
|
||||||
17
includes/polling/os/dell-ups.inc.php
Normal file
17
includes/polling/os/dell-ups.inc.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* LibreNMS
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version. Please see LICENSE.txt at the top level of
|
||||||
|
* the source code distribution for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$data = snmp_get_multi($device, 'productIDDisplayName.0 productIDVendor.0 productIDVersion.0 physicalIdentSerialNumber.0', '-OQUs', 'DELL-SNMP-UPS-MIB');
|
||||||
|
|
||||||
|
$hardware = $data[0]['productIDDisplayName'];
|
||||||
|
$serial = $data[0]['physicalIdentSerialNumber'];
|
||||||
|
$version = $data[0]['productIDVersion'] . $data[0]['productIDVendor'];
|
||||||
1491
mibs/dell/DELL-SNMP-UPS-MIB
Normal file
1491
mibs/dell/DELL-SNMP-UPS-MIB
Normal file
File diff suppressed because it is too large
Load Diff
@@ -421,6 +421,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->checkOS('dell-laser', 'dell-laser-mfp');
|
$this->checkOS('dell-laser', 'dell-laser-mfp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDellups()
|
||||||
|
{
|
||||||
|
$this->checkOS('dell-ups');
|
||||||
|
}
|
||||||
|
|
||||||
public function testDeltaups()
|
public function testDeltaups()
|
||||||
{
|
{
|
||||||
$this->checkOS('deltaups');
|
$this->checkOS('deltaups');
|
||||||
|
|||||||
2
tests/snmpsim/dell-ups.snmprec
Normal file
2
tests/snmpsim/dell-ups.snmprec
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1.3.6.1.2.1.1.1.0|4|Dell UPS Rack 3750W High Efficiency Online HV
|
||||||
|
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.674.10902.2
|
||||||
Reference in New Issue
Block a user