newdevice: Added support for DCN switches #5031 (#5238)

This commit is contained in:
Neil Lathwood
2016-12-28 22:34:21 +00:00
committed by Søren Rosiak
parent cfddc11e76
commit 67362e0124
6 changed files with 79 additions and 0 deletions

BIN
html/images/os/dcn.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

View File

@@ -0,0 +1,8 @@
os: dcn-software
text: 'Digital China Networks'
type: network
icon: dcn
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_mempool, text: 'Memory Usage' }

View File

@@ -0,0 +1,34 @@
<?php
/**
* dcn-software.inc.php
*
* LibreNMS os discovery module for DCN
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
$dcn_oids = array(
'.1.3.6.1.4.1.6339.1.1.1.280',
);
if (starts_with($sysObjectId, $dcn_oids)) {
$os = 'dcn-software';
}
unset($dcn_oids);

View File

@@ -0,0 +1,30 @@
<?php
/**
* dcn-software.inc.php
*
* LibreNMS os poller module for DCN
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
preg_match('/([\w-]+) Device, .* SoftWare Version ([\w\.\(\)]+) .* Serial No.:([\w]+) .*/', $poll_device['sysDescr'], $match);
$hardware = $match[1];
$version = $match[2];
$serial = $match[3];

View File

@@ -393,6 +393,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('datadomain');
}
public function testDcnSoftware()
{
$this->checkOS('dcn-software');
}
public function testDdnos()
{
$this->checkOS('ddnos');

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|S4600-52P-SI Device, Compiled Jun 06 16:24:54 2016 SoftWare Version 7.0.3.5(R0241.0101) BootRom Version 7.2.16 HardWare Version 1.0.1 Serial No.:SW045010FB16000330 Copyright (C) 2001-2016 by Digital China Networks Limited. All rights reserved
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6339.1.1.1.280