diff --git a/html/images/logos/cradlepoint.png b/html/images/logos/cradlepoint.png new file mode 100644 index 0000000000..49df31c82d Binary files /dev/null and b/html/images/logos/cradlepoint.png differ diff --git a/html/images/os/cradlepoint.png b/html/images/os/cradlepoint.png new file mode 100644 index 0000000000..cf63ed00bf Binary files /dev/null and b/html/images/os/cradlepoint.png differ diff --git a/includes/definitions/wipipe.yaml b/includes/definitions/wipipe.yaml new file mode 100644 index 0000000000..462fb577cb --- /dev/null +++ b/includes/definitions/wipipe.yaml @@ -0,0 +1,9 @@ +os: wipipe +text: 'CradlePoint WiPipe' +type: network +icon: cradlepoint +mib_dir: + - cradlepoint +discovery: + - sysObjectId: + - .1.3.6.1.4.1.20992. diff --git a/includes/discovery/sensors/dbm/wipipe.inc.php b/includes/discovery/sensors/dbm/wipipe.inc.php new file mode 100644 index 0000000000..574cb7b8b5 --- /dev/null +++ b/includes/discovery/sensors/dbm/wipipe.inc.php @@ -0,0 +1,48 @@ + + * + * 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' + ); + } +} diff --git a/includes/discovery/sensors/pre-cache/wipipe.inc.php b/includes/discovery/sensors/pre-cache/wipipe.inc.php new file mode 100644 index 0000000000..9108eae5b6 --- /dev/null +++ b/includes/discovery/sensors/pre-cache/wipipe.inc.php @@ -0,0 +1,16 @@ + + * + * 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 'Caching WIPIPE-MIB'; +$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, 'mdmEntry', array(), 'WIPIPE-MIB'); diff --git a/includes/discovery/sensors/state/wipipe.inc.php b/includes/discovery/sensors/state/wipipe.inc.php new file mode 100644 index 0000000000..60d9b5ec60 --- /dev/null +++ b/includes/discovery/sensors/state/wipipe.inc.php @@ -0,0 +1,91 @@ + + * + * 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"; + +foreach ($pre_cache['wipipe_oids'] as $index => $entry) { + // Modem Connection Status + if ($entry['mdmStatus']) { + $cur_oid = '.1.3.6.1.4.1.20992.1.2.2.1.5.'; + //Create State Index + $state_name = 'mdmStatus'; + $state_index_id = create_state_index($state_name); + //Create State Translation + if ($state_index_id) { + $states = array( + array($state_index_id,'established',0,1,0) , + array($state_index_id,'establishing',0,2,0) , + array($state_index_id,'ready',0,3,0) , + array($state_index_id,'error',0,4,2) , + array($state_index_id,'disconnected',0,5,2) , + array($state_index_id,'disconnecting',0,6,1) , + array($state_index_id,'suspended',0,7,2) , + array($state_index_id,'empty',0,8,3) , + array($state_index_id,'notconfigured',0,9,3) , + array($state_index_id,'userstopped',0,10,1) + ); + foreach ($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } + } + // Get Modem Model & Phone Number for description + $modemdesc = $entry['mdmDescr']; + $modemmdn = $entry['mdmMDN']; + $descr = "mdmStatus - " . $modemdesc . " - " . $modemmdn; + //Discover Sensors + discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['mdmStatus'], 'snmp', $index); + //Create Sensor To State Index + create_sensor_to_state_index($device, $state_name, $index); + } +} +// Device Firmware Upgrade Status +$upgradestatus = snmpwalk_cache_oid($device, 'devFWUpgradeStatus', array(), 'WIPIPE-MIB'); +foreach ($upgradestatus as $index => $entry) { + $cur_oid = '.1.3.6.1.4.1.20992.1.1.4.'; + //Create State Index + $state_name = 'devFWUpgradeStatus'; + $state_index_id = create_state_index($state_name); + //Create State Translation + if ($state_index_id) { + $states = array( + array($state_index_id,'idle',0,1,0) , + array($state_index_id,'upgrading',0,2,0) , + array($state_index_id,'uptodate',0,3,0) , + array($state_index_id,'updateAvail',0,4,1) , + array($state_index_id,'failure',0,5,2) + ); + foreach ($states as $value) { + $insert = array( + 'state_index_id' => $value[0], + 'state_descr' => $value[1], + 'state_draw_graph' => $value[2], + 'state_value' => $value[3], + 'state_generic_value' => $value[4] + ); + dbInsert($insert, 'state_translations'); + } + } + $descr = "Firmware Upgrade Status"; + //Discover Sensors + discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['devFWUpgradeStatus'], 'snmp', $index); + //Create Sensor To State Index + create_sensor_to_state_index($device, $state_name, $index); +} diff --git a/includes/polling/os/wipipe.inc.php b/includes/polling/os/wipipe.inc.php new file mode 100644 index 0000000000..40bc7a62fe --- /dev/null +++ b/includes/polling/os/wipipe.inc.php @@ -0,0 +1,18 @@ + + * + * 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. + */ + +// Rip hardware and firmware version from sysDescr string -- example: Cradlepoint CBA850, Firmware Version 6.2.0.dd92f49 +preg_match('/(.*) ([\w\d]+), (.*) ([\w\d\.]+)/', $poll_device['sysDescr'], $wipipe_data); +$hardware = $wipipe_data[2]; +$version = $wipipe_data[4]; diff --git a/mibs/cradlepoint/WIPIPE-MIB b/mibs/cradlepoint/WIPIPE-MIB new file mode 100644 index 0000000000..7d692c5e16 --- /dev/null +++ b/mibs/cradlepoint/WIPIPE-MIB @@ -0,0 +1,520 @@ +WIPIPE-MIB DEFINITIONS ::= BEGIN + +-- WiPipe MIB Release 1.13 + +-- Copyright 2008-2016 by CradlePoint, Inc. All rights reserved + +-- This Specification is supplied "AS IS", CradlePoint makes no warranty, +-- either expressed or implied, as to the use, operation, condition, +-- or performance of the Specification. + +IMPORTS + enterprises + FROM RFC1155-SMI + OBJECT-TYPE + FROM RFC-1212; + +-- =============================================================================================== + +-- textual conventions + +DisplayString ::= + OCTET STRING +-- This data type is used to model textual information taken +-- from the NVT ASCII character set. By convention, objects +-- with this syntax are declared as having + +-- +-- SIZE (0..255) + +PhysAddress ::= + OCTET STRING +-- This data type is used to model media addresses. For many +-- types of media, this will be in a binary representation. +-- For example, an ethernet address would be represented as +-- a string of 6 octets. + + + +-- groups in WIPIPE + +wipipe OBJECT IDENTIFIER ::= { enterprises 20992 } + +wipipeMgmt OBJECT IDENTIFIER ::= { wipipe 1 } + +wipipeProd OBJECT IDENTIFIER ::= { wipipe 2 } + +mbr1000 OBJECT IDENTIFIER ::= { wipipeProd 1 } + +ctr500 OBJECT IDENTIFIER ::= { wipipeProd 2 } + +mbr800 OBJECT IDENTIFIER ::= { wipipeProd 3 } + +mbr1100 OBJECT IDENTIFIER ::= { wipipeProd 4 } + +mbr1200 OBJECT IDENTIFIER ::= { wipipeProd 5 } + +mbr900 OBJECT IDENTIFIER ::= { wipipeProd 6 } + +cba250 OBJECT IDENTIFIER ::= { wipipeProd 7 } + +cba750 OBJECT IDENTIFIER ::= { wipipeProd 8 } + +cx111 OBJECT IDENTIFIER ::= { wipipeProd 9 } + +mbr1400 OBJECT IDENTIFIER ::= { wipipeProd 10 } + +mbr1200b OBJECT IDENTIFIER ::= { wipipeProd 11 } + +cbr400 OBJECT IDENTIFIER ::= { wipipeProd 12 } + +cbr450 OBJECT IDENTIFIER ::= { wipipeProd 13 } + +ibr600 OBJECT IDENTIFIER ::= { wipipeProd 14 } + +ibr650 OBJECT IDENTIFIER ::= { wipipeProd 15 } + +mbr1400v2 OBJECT IDENTIFIER ::= { wipipeProd 16 } + +cba750b OBJECT IDENTIFIER ::= { wipipeProd 17 } + +aer2100 OBJECT IDENTIFIER ::= { wipipeProd 18 } + +ibr1150 OBJECT IDENTIFIER ::= { wipipeProd 19 } + +ibr1100 OBJECT IDENTIFIER ::= { wipipeProd 20 } + +cba850 OBJECT IDENTIFIER ::= { wipipeProd 21 } + +ibr350 OBJECT IDENTIFIER ::= { wipipeProd 22 } + +aer3100 OBJECT IDENTIFIER ::= { wipipeProd 23 } + +aer1600 OBJECT IDENTIFIER ::= { wipipeProd 24 } + +ibr650b OBJECT IDENTIFIER ::= { wipipeProd 25 } + +aer3150 OBJECT IDENTIFIER ::= { wipipeProd 26 } + +aer1650 OBJECT IDENTIFIER ::= { wipipeProd 27 } + +aer2150 OBJECT IDENTIFIER ::= { wipipeProd 28 } + +ibr600b OBJECT IDENTIFIER ::= { wipipeProd 29 } + +ibr950 OBJECT IDENTIFIER ::= { wipipeProd 30 } + +ibr900 OBJECT IDENTIFIER ::= { wipipeProd 31 } + +wipipeDevice OBJECT IDENTIFIER ::= { wipipeMgmt 1 } + +wipipeCellMdm OBJECT IDENTIFIER ::= { wipipeMgmt 2 } + + +-- the WiPipe Device Management group + +devFWVersion OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual description providing the firmware + version currently running on the device. + It is mandatory that this only contain + printable ASCII characters. + @GET-FUNC=snmp_get_devFWVersion" +::= { wipipeDevice 1 } + +devFWUpgrade OBJECT-TYPE + SYNTAX INTEGER { + none (1), + auto (2), + manual (3) + } + ACCESS read-write + STATUS mandatory + DESCRIPTION + "Initiate a FW upgrade on the device. + none - No upgrade is being performed or initiated. + auto - If no other upgrade is begin performed, when this value + is written then an automatic upgrade will be performed. + When an automatic upgrade is done then the device will + pull the most current FW image from the Wipipe server + and install it. + If this value is read then the router is performing an + automatic upgrade and the devFWUpgradeStatus object should + be read for further information. + manual - If no other upgrade is begin performed, when this value + is written then a manual upgrade will be performed. + When an manual upgrade is done it will use the URL set + in the devFWUpgradeURL object as the place to get the + firmware image and install. If the devFWUpgradeURL object + is not set then no upgrade will be performed. + If this value is read then the router is performing an + manual upgrade and the devFWUpgradeStatus object should + be read for further information. - + @SET-FUNC=snmp_set_devFWUpgrade + @GET-FUNC=snmp_get_devFWUpgrade" +::= { wipipeDevice 2 } + +devFWUpgradeURL OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + ACCESS read-write + STATUS mandatory + DESCRIPTION + "Set the URL that points to the firmware image that will be used + when doing a manual firmware upgrade. + @SET-FUNC=snmp_set_devFWUpgradeURL + @GET-FUNC=snmp_get_devFWUpgradeURL" +::= { wipipeDevice 3 } + +devFWUpgradeStatus OBJECT-TYPE + SYNTAX INTEGER { + idle (1), + upgrading (2), + uptodate (3), + updateAvail (4), + failure (5) + } + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Show the result of the FW upgrade command. + idle = there is no upgrade in process. + upgrading = the new FW is being downloaded and written to flash. + uptodate = the device is already at the latest FW. Nothing to upgrade. + updateAvail - the device has an automatic update available. + failure = some sort of failure occurred during the upgrade. + The FW will not be upgraded. + NOTE - while the FW image is being written to flash interrupts are + disabled so no status will be returned at this time. + User should get the FW version string in order to determine if the + unit has been updated successfully. + @GET-FUNC=snmp_get_devFWUpgradeStatus" +::= { wipipeDevice 4 } + + +devGpioConfigInput OBJECT-TYPE + SYNTAX INTEGER { + none (1), + input (2), + reboot (3), + ignitionSensing (4) + } + ACCESS read-write + STATUS mandatory + DESCRIPTION + "Set the Input GPIO config on the connector. + none - ignore input value. + input - read the input value. + reboot - if the input is held low for 10 seconds, + reboot the router. + ignition_sensing - if the input is held low for 300 seconds, + power off the router. IBR11x0 series feature. + @SET-FUNC=snmp_set_devGpioConfigInput + @GET-FUNC=snmp_get_devGpioConfigInput" +::= { wipipeDevice 5 } + +devGpioReadInput OBJECT-TYPE + SYNTAX INTEGER (0..1) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Read the Input GPIO value on the connector. + 0 - low. + 1 - high. + @SET-FUNC=snmp_set_devGpioReadInput + @GET-FUNC=snmp_get_devGpioReadInput" +::= { wipipeDevice 6 } + +devGpioConfigOutput OBJECT-TYPE + SYNTAX INTEGER { + low (1), + high (2), + routerRunning (3), + modemConnected (4) + } + ACCESS read-write + STATUS mandatory + DESCRIPTION + "Set the output GPIO config on the connector. + low - Default low output value. + high - high output value. + routerRunning - high output value once the router completes + its boot process. + modemConnected - high output value when the modem completes a + data connection + @SET-FUNC=snmp_set_devGpioConfigOutput + @GET-FUNC=snmp_get_devGpioConfigOutput" +::= { wipipeDevice 7 } + +devGpioReadOutput OBJECT-TYPE + SYNTAX INTEGER (0..1) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "Read the Output GPIO value on the connector. + 0 - low. + 1 - high. + @SET-FUNC=snmp_set_devGpioReadOutput + @GET-FUNC=snmp_get_devGpioReadOutput" +::= { wipipeDevice 8 } + +-- The WiPipe Cellular Modem Management Group + +mdmNumber OBJECT-TYPE + SYNTAX INTEGER (0..10) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The number of Cellular Modems (regardless of their + current state) present on this system. + @GET-FUNC=snmp_get_mdmNumber" + ::= { wipipeCellMdm 1 } + + +mdmTable OBJECT-TYPE + SYNTAX SEQUENCE OF MdmEntry + ACCESS not-accessible + STATUS mandatory + DESCRIPTION + "A list of Modem entries. The number of entries is + given by the value of ifNumber." + ::= { wipipeCellMdm 2 } + +mdmEntry OBJECT-TYPE + SYNTAX MdmEntry + ACCESS not-accessible + STATUS mandatory + DESCRIPTION + "An entry containing management information applicable to a + particular modem. + @ROW-FUNC=snmp_get_mdmTable_row" + INDEX { mdmIndex }::= { mdmTable 1 } + +MdmEntry ::= + SEQUENCE { + mdmIndex INTEGER, + mdmDescr DisplayString, + mdmPort DisplayString, + mdmSignalStrength INTEGER, + mdmStatus INTEGER, + mdmECIO INTEGER, + mdmSerialNumber DisplayString, + mdmFirmwareVersion DisplayString, + mdmMDN DisplayString, + mdmSERDIS DisplayString, + mdmPROF DisplayString, + mdmCINR INTEGER, + mdmSINR INTEGER, + mdmRSRP INTEGER, + mdmRSRQ INTEGER, + mdmROAM INTEGER, + mdmRFBAND DisplayString, + mdmHOMECARRIER DisplayString, + mdmIMSI DisplayString, + mdmIMEI DisplayString, + mdmAPN DisplayString, + mdmRFCHANNEL DisplayString + } + + + +mdmIndex OBJECT-TYPE + SYNTAX INTEGER (0..10) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A unique value, greater than zero, for each cellular modem. It + is recommended that values are assigned contiguously + starting from 1. The value for each interface sub-layer + must remain constant at least from one re-initialization of + the entity's network management system to the next re- + initialization." + ::= { mdmEntry 1 } + +mdmDescr OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string containing information about the + modem." + ::= { mdmEntry 2 } + +mdmPort OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string containing information about what + port the modem is installed in." + ::= { mdmEntry 3 } + +mdmSignalStrength OBJECT-TYPE + SYNTAX INTEGER (-120..-30) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems signal strength, given in + dBm's." + ::= { mdmEntry 4 } + +mdmStatus OBJECT-TYPE + SYNTAX INTEGER { + established (1), + establishing (2), + ready (3), + error (4), + disconnected (5), + disconnecting (6), + suspended (7), + empty (8), + notconfigured (9), + userstopped (10) + } + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string containing infomation of the state + of the modem." + ::= { mdmEntry 5 } + +mdmECIO OBJECT-TYPE + SYNTAX INTEGER (-120..0) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems Ec/Io ratio given in dBm's." + ::= { mdmEntry 6 } + +mdmSerialNumber OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string representing the unique serial number of the device." + ::= { mdmEntry 7 } + +mdmFirmwareVersion OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..64)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string representing the current firmware version of the modem. + Not all modems report this value." + ::= { mdmEntry 8 } + +mdmMDN OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string representing the unique Mobile Directory Number of the device." + ::= { mdmEntry 9 } + +mdmSERDIS OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string representing the Service Display of the device." + ::= { mdmEntry 10 } + +mdmPROF OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "A textual string representing the Profile of the device." + ::= { mdmEntry 11 } + +mdmCINR OBJECT-TYPE + SYNTAX INTEGER (-120..0) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems CINR ratio given in dBm's." + ::= { mdmEntry 12 } + +mdmSINR OBJECT-TYPE + SYNTAX INTEGER (-20..40) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems SINR ratio given in dBm's." + ::= { mdmEntry 13 } + +mdmRSRP OBJECT-TYPE + SYNTAX INTEGER (-120..100) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems RSRP given in dBm's." + ::= { mdmEntry 14 } + +mdmRSRQ OBJECT-TYPE + SYNTAX INTEGER (-120..50) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems RSRQ given in dBm's." + ::= { mdmEntry 15 } + +mdmROAM OBJECT-TYPE + SYNTAX INTEGER (0..2) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems Roaming Status." + ::= { mdmEntry 16 } + +mdmRFBAND OBJECT-TYPE + SYNTAX DisplayString + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems RF band." + ::= { mdmEntry 17 } + +mdmHOMECARRIER OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems Home Carrier." + ::= { mdmEntry 18 } + +mdmIMSI OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems IMSI." + ::= { mdmEntry 19 } + +mdmIMEI OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems IMEI." + ::= { mdmEntry 20 } + +mdmAPN OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems APN." + ::= { mdmEntry 21 } + +mdmRFCHANNEL OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..32)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The cellular modems RF Channel." + ::= { mdmEntry 22 } + +END diff --git a/tests/snmpsim/wipipe.snmprec b/tests/snmpsim/wipipe.snmprec new file mode 100644 index 0000000000..14844fde4d --- /dev/null +++ b/tests/snmpsim/wipipe.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.1.0|4|Cradlepoint CBA850, Firmware Version 6.2.0.dd92f49 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.20992.2.21