mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Merge pull request #947 from f0o/issue-923
Basic Ubiquiti EdgeSwitch implementation
This commit is contained in:
@@ -404,6 +404,9 @@ $config['bad_iftype'][] = "mpls";
|
||||
$config['bad_if_regexp'][] = "/^ng[0-9]+$/";
|
||||
$config['bad_if_regexp'][] = "/^sl[0-9]/";
|
||||
|
||||
// Rewrite Interfaces
|
||||
$config['rewrite_if_regexp']['/^cpu interface/'] = 'Mgmt';
|
||||
|
||||
$config['processor_filter'][] = "An electronic chip that makes the computer work.";
|
||||
|
||||
$config['ignore_mount_removable'] = 1; # Ignore removable disk storage
|
||||
|
||||
@@ -1088,6 +1088,15 @@ $config['os'][$os]['text'] = "Datacom";
|
||||
$config['os'][$os]['type'] = "network";
|
||||
$config['os'][$os]['icon'] = "datacom";
|
||||
|
||||
// UBNT EdgeSwitch 750W
|
||||
$os = "edgeswitch";
|
||||
$config['os'][$os]['text'] = "EdgeSwitch";
|
||||
$config['os'][$os]['type'] = "network";
|
||||
$config['os'][$os]['icon'] = "ubiquiti";
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||
$config['os'][$os]['ifname'] = 1;
|
||||
|
||||
foreach ($config['os'] as $this_os => $blah)
|
||||
{
|
||||
if (isset($config['os'][$this_os]['group']))
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
if (!$os) {
|
||||
if (strstr($sysObjectId, ".1.3.6.1.4.1.4413")) {
|
||||
$os = "edgeswitch";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
//SNMPv2-MIB::sysDescr.0 = STRING: EdgeSwitch 48-Port 750W, 1.1.2.4767216, Linux 3.6.5-f4a26ed5
|
||||
if( preg_match('/^(EdgeSwitch .*), (.*), Linux .*$/', $poll_device['sysDescr'], $regexp_result)) {
|
||||
$hardware = $regexp_result[1];
|
||||
$version = $regexp_result[2];
|
||||
$serial = trim(snmp_get($device, ".1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq") , '" ');
|
||||
}
|
||||
Reference in New Issue
Block a user