mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added detection for ZTE zxdsl devices (#10344)
* add yaml files * Added include/definition/zxdsl.yaml (ZTE ZXDSL Support) Added include/polling/os/zxdsl.inc.php (Set Hardware) * Changed includes/definitions/zxdsl.yaml type from "dslam" to "network" Changed includes/polling/os/zxdsl.inc.php removed unnecessary code Added Testfiles * Fixed coding guideline errors (missing spaces) * Removed unnecessary "use" * Improved model number discovery Removed unavailable top graphs Added System temperature * Changed Temperature limits according to ZTE datasheet * Updated Tests
This commit is contained in:
26
includes/polling/os/zxdsl.inc.php
Normal file
26
includes/polling/os/zxdsl.inc.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
if (strstr($device['sysObjectID'], '.1.3.6.1.4.1.3902.')) {
|
||||
$sysObjectId = str_replace('.1.3.6.1.4.1.3902.', '', $device['sysObjectID']);
|
||||
preg_match(
|
||||
'/.1.3.6.1.4.1.3902.(1004|1015).(.*).1.1.1/',
|
||||
$device['sysObjectID'],
|
||||
$matches,
|
||||
PREG_OFFSET_CAPTURE
|
||||
);
|
||||
|
||||
$sysObjectId = $matches[2][0];
|
||||
$sysObjectIdSplit = explode('.', $sysObjectId);
|
||||
|
||||
if (count($sysObjectIdSplit) >= 1) {
|
||||
$hardware = "ZXDSL ".$sysObjectIdSplit[0];
|
||||
if (count($sysObjectIdSplit) >= 2) {
|
||||
for ($i = 1; $i < count($sysObjectIdSplit); $i++) {
|
||||
$hardware .= chr(64+$sysObjectIdSplit[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($matches);
|
||||
unset($sysObjectId);
|
||||
unset($sysObjectIdSplit);
|
||||
}
|
||||
Reference in New Issue
Block a user