Merge pull request #947 from f0o/issue-923

Basic Ubiquiti EdgeSwitch implementation
This commit is contained in:
Neil Lathwood
2015-05-09 22:47:36 +01:00
4 changed files with 25 additions and 0 deletions
+3
View File
@@ -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
+9
View File
@@ -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']))
+6
View File
@@ -0,0 +1,6 @@
<?php
if (!$os) {
if (strstr($sysObjectId, ".1.3.6.1.4.1.4413")) {
$os = "edgeswitch";
}
}
+7
View File
@@ -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") , '" ');
}