Chris A. Evans 8c8d591d67 newdevice: Add basic support for CradlePoint WiPipe Cellular Broadband Routers (#6695)
* Add basic support for CradlePoint Ceullular Broadband Rotuers

 	new file:   html/images/os/cradlepoint.png
 	new file:   includes/definitions/wipipe.yaml
 	new file:   includes/discovery/sensors/dbm/wipipe.inc.php
 	new file:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	new file:   includes/discovery/sensors/state/wipipe.inc.php
 	new file:   includes/polling/os/wipipe.inc.php

* Added snmprec test file

* Updated definitions file

* Updated copyright blocks and comments

* Added WIPIPE-MIB#

*  	renamed:    tests/snmpsim/wipipe.smmprec -> tests/snmpsim/wipipe.snmprec

*  	copied:     html/images/os/cradlepoint.png -> html/images/logos/cradlepoint.png
 	modified:   html/images/os/cradlepoint.png
 	modified:   includes/definitions/wipipe.yaml
 	modified:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	modified:   includes/polling/os/wipipe.inc.php

* Changes requested by laf

 	modified:   includes/discovery/sensors/dbm/wipipe.inc.php
 	modified:   includes/discovery/sensors/pre-cache/wipipe.inc.php
 	modified:   includes/polling/os/wipipe.inc.php

* Reworked devFWUpgradeStatus state sensor
 	modified:   includes/discovery/sensors/state/wipipe.inc.php

* Fixed hardware/OS version detection
 	modified:   includes/polling/os/wipipe.inc.php

* moved mib file to correct location
2017-05-31 21:45:31 +01:00

49 lines
1.4 KiB
PHP

<?php
/*
* LibreNMS Interface Modem Signal Strength dBm module for the CradlePoint WiPipe Platform
*
* © 2017 Chris A. Evans <thecityofguanyu@outlook.com>
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
echo 'CradlePoint WiPipe';
$multiplier = 1;
$divisor = 1;
foreach ($pre_cache['wipipe_oids'] as $index => $entry) {
// Modem Signal Strength
if ($entry['mdmSignalStrength']) {
$oid = '.1.3.6.1.4.1.20992.1.2.2.1.4.' . $index;
// Get Modem Model & Phone Number for description
$modemdesc = $entry['mdmDescr'];
$modemmdn = $entry['mdmMDN'];
$descr = "Signal Strength - " . $modemdesc . " - " . $modemmdn;
$currentsignal = $entry['mdmSignalStrength'];
// Discover Sensor
discover_sensor(
$valid['sensor'],
'dbm',
$device,
$oid,
'mdmSignalStrength.'.$index,
'wipipe',
$descr,
$divisor,
$multiplier,
null,
null,
null,
null,
$currentsignal,
'snmp'
);
}
}