newdevice: Added support for Saf Integra Access points (#7292)

* newdevice: Added support for Saf Integra Access points

* Split SAF Integra models out

* added polling files

* Update saf-integra-b.yaml

* Update saf-integra-w.yaml
This commit is contained in:
Neil Lathwood
2017-09-08 22:22:03 +02:00
committed by Tony Murray
parent f97b0b87a3
commit 455c72156d
16 changed files with 5047 additions and 14 deletions

180
LibreNMS/OS/SafIntegraB.php Normal file
View File

@@ -0,0 +1,180 @@
<?php
/**
* Saf-Integra.php
*
* Saf Integra wireless radios
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
namespace LibreNMS\OS;
use LibreNMS\Device\WirelessSensor;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessMseDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessQualityDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRateDiscovery;
use LibreNMS\OS;
class SafIntegraB extends OS implements
WirelessFrequencyDiscovery,
WirelessMseDiscovery,
WirelessPowerDiscovery,
WirelessRateDiscovery,
WirelessQualityDiscovery
{
/**
* Discover wireless frequency. This is in MHz. Type is frequency.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessFrequency()
{
return array(
// SAF-INTEGRAB-MIB::integraBradioTxFrequency
new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.2.2.0',
'saf-integrab-tx',
'integraBradioTxFrequency',
'Tx Frequency',
null,
1,
1000
),
// SAF-INTEGRAB-MIB::integraBradioRxFrequency
new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.2.7.0',
'saf-integrab-rx',
'integraBradioRxFrequency',
'Rx Frequency',
null,
1,
1000
),
);
}
/**
* Discover wireless MSE. Mean square error value *10 in dB.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessMse()
{
return array(
// SAF-INTEGRAB-MIB::integraBmodemMse
new WirelessSensor(
'mse',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.3.2.0',
'saf-integrab-modem',
'integraBmodemMse',
'Modem MSE',
null,
1,
10
),
);
}
/**
* Discover wireless tx or rx power. This is in dBm. Type is power.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array
*/
public function discoverWirelessPower()
{
return array(
// SAF-INTEGRAB-MIB::integraBradioTxPower
new WirelessSensor(
'power',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.2.1.0',
'saf-integrab-rx',
'integraBradioTxPower',
'Rx Power'
),
);
}
/**
* Discover wireless rate. This is in bps. Type is rate.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array
*/
public function discoverWirelessRate()
{
return array(
// SAF-INTEGRAB-MIB::integraBmodemRxCapacity
new WirelessSensor(
'rate',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.3.10.0',
'saf-integrab-rx',
'integraBmodemRxCapacity',
'RX Capacity',
null,
1000
),
// SAF-INTEGRAB-MIB::integraBmodemTxCapacity
new WirelessSensor(
'rate',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.3.11.0',
'saf-integrab-tx',
'integraBmodemTxCapacity',
'TX Capacity',
null,
1000
),
);
}
/**
* Discover wireless quality. This is a percent. Type is quality.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessQuality()
{
return array(
// SAF-INTEGRAB-MIB::integraBmodemSignalQuality
new WirelessSensor(
'quality',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.1.3.14.0',
'saf-integrab-quality',
'integraBmodemSignalQuality',
'Model Signal',
null,
1
),
);
}
}

180
LibreNMS/OS/SafIntegraW.php Normal file
View File

@@ -0,0 +1,180 @@
<?php
/**
* Saf-Integra.php
*
* Saf Integra wireless radios
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
namespace LibreNMS\OS;
use LibreNMS\Device\WirelessSensor;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessMseDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessQualityDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRateDiscovery;
use LibreNMS\OS;
class SafIntegraW extends OS implements
WirelessFrequencyDiscovery,
WirelessMseDiscovery,
WirelessPowerDiscovery,
WirelessRateDiscovery,
WirelessQualityDiscovery
{
/**
* Discover wireless frequency. This is in MHz. Type is frequency.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessFrequency()
{
return array(
// SAF-INTEGRAW-MIB::integraWradioTxFrequency
new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.2.2.0',
'saf-integra-tx',
'integraWradioTxFrequency',
'Tx Frequency',
null,
1,
1000
),
// SAF-INTEGRAW-MIB::integraWradioRxFrequency
new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.2.7.0',
'saf-integra-rx',
'integraWradioRxFrequency',
'Rx Frequency',
null,
1,
1000
),
);
}
/**
* Discover wireless MSE. Mean square error value *10 in dB.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessMse()
{
return array(
// SAF-INTEGRAW-MIB::integraWmodemMse
new WirelessSensor(
'mse',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.3.2.0',
'saf-integraw-modem',
'integraWmodemMse',
'Modem MSE',
null,
1,
10
),
);
}
/**
* Discover wireless tx or rx power. This is in dBm. Type is power.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array
*/
public function discoverWirelessPower()
{
return array(
// SAF-INTEGRAW-MIB::integraWradioTxPower
new WirelessSensor(
'power',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.2.1.0',
'saf-integra-rx',
'integraWradioTxPower',
'Rx Power'
),
);
}
/**
* Discover wireless rate. This is in bps. Type is rate.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array
*/
public function discoverWirelessRate()
{
return array(
// SAF-INTEGRAW-MIB::integraWmodemRxCapacity
new WirelessSensor(
'rate',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.3.10.0',
'saf-integra-rx',
'integraWmodemRxCapacity',
'RX Capacity',
null,
1000
),
// SAF-INTEGRAW-MIB::integraWmodemTxCapacity
new WirelessSensor(
'rate',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.3.11.0',
'saf-integra-tx',
'integraWmodemTxCapacity',
'TX Capacity',
null,
1000
),
);
}
/**
* Discover wireless quality. This is a percent. Type is quality.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessQuality()
{
return array(
// SAF-INTEGRAW-MIB::integraWmodemSignalQuality
new WirelessSensor(
'quality',
$this->getDeviceId(),
'.1.3.6.1.4.1.7571.100.1.1.7.2.3.14.0',
'saf-integra-quality',
'integraWmodemSignalQuality',
'Model Signal',
null,
1
),
);
}
}

View File

@@ -0,0 +1,57 @@
mib: SAF-INTEGRAB-MIB
modules:
sensors:
temperature:
options:
divisor: 10
data:
-
oid: integraBsysCPUtemperature
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.2.
descr: System CPU
index: 'integraBsysCPUtemperature.{{ $index }}'
-
oid: integraBsysBoardTemperature
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.8.
descr: System Board
index: 'integraBsysBoardTemperature.{{ $index }}'
voltage:
options:
divisor: 1000
data:
-
oid: integraBsysPSUvoltage
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.5.
descr: PSU Voltage
index: 'integraBsysPSUvoltage.{{ $index }}'
current:
options:
divisor: 1000
data:
-
oid: integraBsysPSUcurrent
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.6.
descr: PSU Current
index: 'integraBsysPSUcurrent.{{ $index }}'
power:
options:
divisor: 1000
data:
-
oid: integraBsysPSUpower
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.7.
descr: PSU Power
index: 'integraBsysPSUpower.{{ $index }}'
state:
data:
-
oid: integraBsysLicenseGenStatus
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.1.4.4.
descr: License Status
index: 'integraBsysLicenseGenStatus.{{ $index }}'
state_name: integraBsysLicenseGenStatus
states:
- { value: 1, generic: 0, graph: 1, descr: ok }
- { value: 2, generic: 2, graph: 1, descr: expired }
- { value: 3, generic: 3, graph: 1, descr: unknown }
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }

View File

@@ -0,0 +1,57 @@
mib: SAF-INTEGRAW-MIB
modules:
sensors:
temperature:
options:
divisor: 10
data:
-
oid: integraWsysCPUtemperature
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.2.
descr: System CPU
index: 'integraWsysCPUtemperature.{{ $index }}'
-
oid: integraWsysBoardTemperature
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.8.
descr: System Board
index: 'integraWsysBoardTemperature.{{ $index }}'
voltage:
options:
divisor: 1000
data:
-
oid: integraWsysPSUvoltage
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.5.
descr: PSU Voltage
index: 'integraWsysPSUvoltage.{{ $index }}'
current:
options:
divisor: 1000
data:
-
oid: integraWsysPSUcurrent
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.6.
descr: PSU Current
index: 'integraWsysPSUcurrent.{{ $index }}'
power:
options:
divisor: 1000
data:
-
oid: integraWsysPSUpower
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.7.
descr: PSU Power
index: 'integraWsysPSUpower.{{ $index }}'
state:
data:
-
oid: integraWsysLicenseGenStatus
num_oid: .1.3.6.1.4.1.7571.100.1.1.7.2.4.4.
descr: License Status
index: 'integraWsysLicenseGenStatus.{{ $index }}'
state_name: integraWsysLicenseGenStatus
states:
- { value: 1, generic: 0, graph: 1, descr: ok }
- { value: 2, generic: 2, graph: 1, descr: expired }
- { value: 3, generic: 3, graph: 1, descr: unknown }
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }

View File

@@ -0,0 +1,12 @@
os: saf-integra-b
text: 'SAF Integra B'
type: wireless
icon: saf
group: saf
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectId:
- .1.3.6.1.4.1.7571.100.1.1.7.1

View File

@@ -0,0 +1,12 @@
os: saf-integra-w
text: 'SAF Integra W'
type: wireless
icon: saf
group: saf
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectId:
- .1.3.6.1.4.1.7571.100.1.1.7.2

View File

@@ -0,0 +1,43 @@
<?php
/**
* saf-integra.inc.php
*
* LibreNMS processor discovery module for Saf Integra
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
if ($device['os'] === 'saf-integra') {
echo 'Saf Integra : ';
$oid = '.1.3.6.1.4.1.7571.100.1.1.7.2.4.10.0';
$descr = 'Processor';
$usage = snmp_get($device, $oid, '-Ovqn');
if (is_numeric($usage)) {
$usage = 100 - ($usage / 10);
discover_processor($valid['processor'], $device, $oid, '0', 'saf-integra', $descr, '1', $usage);
}
}
unset(
$oid,
$descr,
$usage
);

View File

@@ -0,0 +1,28 @@
<?php
/**
* saf-integra-b.inc.php
*
* Saf Integra B Polling module
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
$saf_integra = preg_split('/;/', $poll_device['sysDescr']);
$serial = str_replace('S/N: ', '', $saf_integra[8]);

View File

@@ -0,0 +1,28 @@
<?php
/**
* saf-integra-w.inc.php
*
* Saf Integra W Polling module
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
$saf_integra = preg_split('/;/', $poll_device['sysDescr']);
$serial = str_replace('S/N: ', '', $saf_integra[8]);

View File

@@ -0,0 +1,36 @@
<?php
/**
* saf-integra.inc.php
*
* LibreNMS processor poller module for Saf Integra
*
* 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 2017 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
$oid = '.1.3.6.1.4.1.7571.100.1.1.7.2.4.10.0';
$usage = snmp_get($device, $oid, '-Ovqn');
if (is_numeric($usage)) {
$usage = 100 - ($usage / 10);
}
unset(
$oid,
$usage
);

View File

@@ -1,34 +1,40 @@
SAF-ENTERPRISE DEFINITIONS ::= BEGIN
SAF-ENTERPRISE DEFINITIONS ::= BEGIN
-- Definitions for include by other SAF Tehnika mib modules
IMPORTS
enterprises,
MODULE-IDENTITY,
OBJECT-IDENTITY FROM SNMPv2-SMI;
OBJECT-IDENTITY
FROM SNMPv2-SMI;
-- saf OBJECT IDENTIFIER ::= { enterprises 7571 }
-- saf OBJECT IDENTIFIER ::= { enterprises 7571 }
saf MODULE-IDENTITY
LAST-UPDATED "200704030000Z" -- Apr, 04. 2007
LAST-UPDATED "201511120000Z" -- 12 nov 2015
ORGANIZATION "SAF Tehnika"
CONTACT-INFO
"SAF Tehnika technical support
<techsupport@saftehnika.com>"
<techsupport>"
DESCRIPTION
"SAF Tehnika enterprise spec."
"microwave subtree added"
-- Revision history
REVISION "200704030000Z" -- 03 apr 2007
DESCRIPTION
"Initial version"
::= { enterprises 7571 }
tehnika OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Subtree to register SAF tehnika modules"
::= { saf 100 }
tehnika OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Subtree to register SAF tehnika modules"
::= { saf 100 }
-- smiv1
microwaveRadio OBJECT IDENTIFIER ::= { tehnika 1}
pointToPoint OBJECT IDENTIFIER ::= { microwaveRadio 1 }
microwaveRadio OBJECT IDENTIFIER ::= { tehnika 1 }
microwave OBJECT IDENTIFIER ::= { tehnika 2 }
pointToPoint OBJECT IDENTIFIER ::= { microwaveRadio 1 }
-- end smiv1
--

40
mibs/saf/SAF-INTEGRA-MIB Normal file
View File

@@ -0,0 +1,40 @@
SAF-INTEGRA-MIB DEFINITIONS ::= BEGIN
-- Definitions for include by other SAF Tehnika mib modules
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Integer32, Gauge32, Counter64,
TimeTicks
FROM SNMPv2-SMI -- [RFC2578]
pointToPoint
FROM SAF-ENTERPRISE
DisplayString, DateAndTime, PhysAddress
FROM SNMPv2-TC
OBJECT-GROUP, MODULE-COMPLIANCE
FROM SNMPv2-CONF -- [RFC2580]
IANAifType
FROM IANAifType-MIB;
-- saf OBJECT IDENTIFIER ::= { enterprises 7571 }
-- microwaveRadio OBJECT IDENTIFIER ::= { tehnika 1 }
-- pointToPoint OBJECT IDENTIFIER ::= { microwaveRadio 1 }
safIntegra MODULE-IDENTITY
LAST-UPDATED "201501060000Z" -- 06 jan 2015
ORGANIZATION "SAF Tehnika"
CONTACT-INFO
"SAF Tehnika technical support
<techsupport>"
DESCRIPTION
"SAF Integra management base"
-- Revision history
REVISION "201501060000Z" -- 06 jan 2015
DESCRIPTION
"Public Release 1.01.
IntegraB module separated"
REVISION "201309190000Z" -- 19 sep 2013
DESCRIPTION
"Public Release 1.0"
::= { pointToPoint 7 }
END

2765
mibs/saf/SAF-INTEGRAB-MIB Normal file

File diff suppressed because it is too large Load Diff

1585
mibs/saf/SAF-INTEGRAW-MIB Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Prod: Integra;Vers: 3.6.18;Timestamp: 2017-06-12 16:26:01;kernel: 3.15.0;rootfs: 0.0.5;fpga: 0.0.5;devicetree: 0.0.5;P/C: D18BSR03H;S/N: 382920100006
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.7571.100.1.1.7.1

View File

@@ -0,0 +1,2 @@
1.3.6.1.2.1.1.1.0|4|Prod: Integra-W;Vers: 3.6.17-mux;Timestamp: 2017-05-24 16:00:47;kernel: 3.15.0;rootfs: 0.0.5;fpga: 0.0.5;devicetree: 0.0.5;P/C: D18WSR03L;S/N: 391340100285
1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.7571.100.1.1.7.2