mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added SNR Sensor to CMTS Arris (#8840)
DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [X ] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
This commit is contained in:
committed by
Neil Lathwood
parent
20741e1b21
commit
8c610326e3
@ -2,6 +2,8 @@ os: cmts
|
||||
text: 'Arris CMTS'
|
||||
type: network
|
||||
icon: arris
|
||||
mib_dir:
|
||||
- arris
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
|
34
includes/discovery/sensors/pre-cache/cmts.inc.php
Normal file
34
includes/discovery/sensors/pre-cache/cmts.inc.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* cmts.inc.php
|
||||
*
|
||||
* LibreNMS os sensor pre-cache module for Arris CMTS
|
||||
*
|
||||
* 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 2018 TheGreatDoc
|
||||
* @author TheGreatDoc
|
||||
* Based on Neil Lathwood Cisco EPC files
|
||||
*/
|
||||
|
||||
echo 'ifName ';
|
||||
$pre_cache['cmts_ifName'] = snmpwalk_cache_oid($device, 'ifName', array(), 'DOCS-IF-MIB');
|
||||
|
||||
echo 'ifAlias ';
|
||||
$pre_cache['cmts_ifAlias'] = snmpwalk_cache_oid($device, 'ifAlias', array(), 'DOCS-IF-MIB');
|
||||
|
||||
echo 'docsIfSignalQualityTable ';
|
||||
$pre_cache['cmts_docsIfSignalQualityTable'] = snmpwalk_cache_oid($device, 'docsIfSignalQualityTable', array(), 'DOCS-IF-MIB');
|
37
includes/discovery/sensors/snr/cmts.inc.php
Normal file
37
includes/discovery/sensors/snr/cmts.inc.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* cmts.inc.php
|
||||
*
|
||||
* LibreNMS snr discovery module for Arris CMTS
|
||||
*
|
||||
* 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 2018 TheGreatDoc
|
||||
* @author TheGreatDoc
|
||||
* Based on Neil Lathwood Cisco EPC files
|
||||
*/
|
||||
|
||||
foreach ($pre_cache['cmts_docsIfSignalQualityTable'] as $index => $data) {
|
||||
if (is_numeric($data['docsIfSigQSignalNoise'])) {
|
||||
$descr = "Channel {$pre_cache['cmts_ifAlias'][$index]['ifAlias']} - {$pre_cache['cmts_ifName'][$index]['ifName']}";
|
||||
$oid = '.1.3.6.1.2.1.10.127.1.1.4.1.5.' . $index;
|
||||
$divisor = 10;
|
||||
$value = $data['docsIfSigQSignalNoise'];
|
||||
if (preg_match("/.0$/", $pre_cache['cmts_ifName'][$index]['ifName'])) {
|
||||
discover_sensor($valid['sensor'], 'snr', $device, $oid, 'docsIfSigQSignalNoise.'.$index, 'cmts', $descr, $divisor, '1', null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
}
|
1325
tests/data/cmts.json
Normal file
1325
tests/data/cmts.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user