mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: F5 discovery cleanup
This commit is contained in:
@@ -158,18 +158,14 @@ You need to add your desired MIBs to `/opt/librenms/mibs` folder. Afterwards you
|
||||
|
||||
```
|
||||
<?php
|
||||
if (!$os || $os === 'linux') {
|
||||
$f5_sys_parent = '1.3.6.1.4.1.3375.2.1';
|
||||
if (strpos($sysObjectId, $f5_sys_parent)) {
|
||||
$os = 'f5';
|
||||
}
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.3375.2.1')) {
|
||||
$os = 'f5';
|
||||
}
|
||||
|
||||
### MIB definition as an array
|
||||
$f5_mibs = array(
|
||||
"ltmVirtualServStatEntry" => "F5-BIGIP-LOCAL-MIB",
|
||||
);
|
||||
'ltmVirtualServStatEntry' => 'F5-BIGIP-LOCAL-MIB',
|
||||
);
|
||||
|
||||
### Actual registering of the MIB
|
||||
register_mibs($device, $f5_mibs, "includes/discovery/os/f5.inc.php");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
if (!$os || $os === 'linux') {
|
||||
$f5_sys_parent = '1.3.6.1.4.1.3375.2.1';
|
||||
if (strpos($sysObjectId, $f5_sys_parent)) {
|
||||
$os = 'f5';
|
||||
}
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.3375.2.1')) {
|
||||
$os = 'f5';
|
||||
}
|
||||
|
||||
@@ -126,6 +126,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('endian', 'Linux endian');
|
||||
}
|
||||
|
||||
public function testF5()
|
||||
{
|
||||
$this->checkOS('f5', 'Linux', '.1.3.6.1.4.1.3375.2.1.3.4.1000');
|
||||
}
|
||||
|
||||
public function testLinux()
|
||||
{
|
||||
$this->checkOS('linux', 'Linux');
|
||||
|
||||
Reference in New Issue
Block a user