mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Add additional features to SAF Tehnika (#4666)
This commit is contained in:
23
html/includes/graphs/device/saf_modemCapacity.inc.php
Normal file
23
html/includes/graphs/device/saf_modemCapacity.inc.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio');
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrdfilename)) {
|
||||
$rrd_options .= ' COMMENT:" Now Min Max\r" ';
|
||||
$rrd_options .= ' DEF:modemACMCapacity='.$rrdfilename.':modemACMCapacity:AVERAGE ';
|
||||
$rrd_options .= ' DEF:modemTotalCapacity='.$rrdfilename.':modemTotalCapacity:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:acmCapacityMbps=modemACMCapacity,1000,* ';
|
||||
$rrd_options .= ' CDEF:capacityMbps=modemTotalCapacity,1000,* ';
|
||||
$rrd_options .= ' LINE1:acmCapacityMbps#00CC00:"ACM Total Capacity\l" ';
|
||||
$rrd_options .= ' COMMENT:\u ';
|
||||
$rrd_options .= ' GPRINT:acmCapacityMbps:LAST:"%0.2lf %sbps" ';
|
||||
$rrd_options .= ' GPRINT:acmCapacityMbps:MIN:"%0.2lf %sbps" ';
|
||||
$rrd_options .= ' GPRINT:acmCapacityMbps:MAX:"%0.2lf %sbps\r" ';
|
||||
$rrd_options .= ' LINE1:capacityMbps#CC0000:"Total Capacity\l" ';
|
||||
$rrd_options .= ' COMMENT:\u ';
|
||||
$rrd_options .= ' GPRINT:capacityMbps:LAST:"%0.2lf %sbps" ';
|
||||
$rrd_options .= ' GPRINT:capacityMbps:MIN:"%0.2lf %sbps" ';
|
||||
$rrd_options .= ' GPRINT:capacityMbps:MAX:"%0.2lf %sbps\r" ';
|
||||
}
|
||||
16
html/includes/graphs/device/saf_modemRadialMSE.inc.php
Normal file
16
html/includes/graphs/device/saf_modemRadialMSE.inc.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio');
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrdfilename)) {
|
||||
$rrd_options .= ' COMMENT:" Now Min Max\r" ';
|
||||
$rrd_options .= ' DEF:modemRadialMSE='.$rrdfilename.':modemRadialMSE:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:dividedMSE=modemRadialMSE,10,/ ';
|
||||
$rrd_options .= ' LINE1:dividedMSE#CC0000:"Radial MSE\l" ';
|
||||
$rrd_options .= ' COMMENT:\u ';
|
||||
$rrd_options .= ' GPRINT:dividedMSE:LAST:"%3.2lf dB" ';
|
||||
$rrd_options .= ' GPRINT:dividedMSE:MIN:"%3.2lf dB" ';
|
||||
$rrd_options .= ' GPRINT:dividedMSE:MAX:"%3.2lf dB\r" ';
|
||||
}
|
||||
15
html/includes/graphs/device/saf_radioRxLevel.inc.php
Normal file
15
html/includes/graphs/device/saf_radioRxLevel.inc.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio');
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrdfilename)) {
|
||||
$rrd_options .= ' COMMENT:" Now Min Max\r" ';
|
||||
$rrd_options .= ' DEF:radioRxLevel='.$rrdfilename.':radioRxLevel:AVERAGE ';
|
||||
$rrd_options .= ' LINE1:radioRxLevel#CC0000:"RX Level\l" ';
|
||||
$rrd_options .= ' COMMENT:\u ';
|
||||
$rrd_options .= ' GPRINT:radioRxLevel:LAST:"%3.2lf dBm" ';
|
||||
$rrd_options .= ' GPRINT:radioRxLevel:MIN:"%3.2lf dBm" ';
|
||||
$rrd_options .= ' GPRINT:radioRxLevel:MAX:"%3.2lf dBm\r" ';
|
||||
}
|
||||
15
html/includes/graphs/device/saf_radioTxPower.inc.php
Normal file
15
html/includes/graphs/device/saf_radioTxPower.inc.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio');
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrdfilename)) {
|
||||
$rrd_options .= ' COMMENT:" Now Min Max\r" ';
|
||||
$rrd_options .= ' DEF:radioTxPower='.$rrdfilename.':radioTxPower:AVERAGE ';
|
||||
$rrd_options .= ' LINE1:radioTxPower#CC0000:"TX Power\l" ';
|
||||
$rrd_options .= ' COMMENT:\u ';
|
||||
$rrd_options .= ' GPRINT:radioTxPower:LAST:"%3.2lf dBm" ';
|
||||
$rrd_options .= ' GPRINT:radioTxPower:MIN:"%3.2lf dBm" ';
|
||||
$rrd_options .= ' GPRINT:radioTxPower:MAX:"%3.2lf dBm\r" ';
|
||||
}
|
||||
@@ -806,9 +806,9 @@ $config['os'][$os]['icon'] = 'siklu';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Traffic';
|
||||
|
||||
// Saf Wireless
|
||||
// SAF Tehnika
|
||||
$os = 'saf';
|
||||
$config['os'][$os]['text'] = 'SAF Wireless';
|
||||
$config['os'][$os]['text'] = 'SAF Tehnika';
|
||||
$config['os'][$os]['type'] = 'wireless';
|
||||
$config['os'][$os]['icon'] = 'saf';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
@@ -2301,6 +2301,23 @@ $config['graph_types']['device']['siklu_rfinterfaceOtherOctets']['section'] = 'w
|
||||
$config['graph_types']['device']['siklu_rfinterfaceOtherOctets']['order'] = '6';
|
||||
$config['graph_types']['device']['siklu_rfinterfaceOtherOctets']['descr'] = 'Other Octets';
|
||||
|
||||
// SAF support
|
||||
$config['graph_types']['device']['saf_radioRxLevel']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['saf_radioRxLevel']['order'] = '0';
|
||||
$config['graph_types']['device']['saf_radioRxLevel']['descr'] = 'RX Level';
|
||||
|
||||
$config['graph_types']['device']['saf_radioTxPower']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['saf_radioTxPower']['order'] = '1';
|
||||
$config['graph_types']['device']['saf_radioTxPower']['descr'] = 'TX Power';
|
||||
|
||||
$config['graph_types']['device']['saf_modemRadialMSE']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['saf_modemRadialMSE']['order'] = '2';
|
||||
$config['graph_types']['device']['saf_modemRadialMSE']['descr'] = 'Radial MSE';
|
||||
|
||||
$config['graph_types']['device']['saf_modemCapacity']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['saf_modemCapacity']['order'] = '3';
|
||||
$config['graph_types']['device']['saf_modemCapacity']['descr'] = 'Capacity';
|
||||
|
||||
// Sub10 support
|
||||
$config['graph_types']['device']['sub10_sub10RadioLclTxPower']['section'] = 'wireless';
|
||||
$config['graph_types']['device']['sub10_sub10RadioLclTxPower']['order'] = '0';
|
||||
|
||||
20
includes/discovery/sensors/temperatures/saf.inc.php
Normal file
20
includes/discovery/sensors/temperatures/saf.inc.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'saf') {
|
||||
$mib = 'SAF-IPRADIO::sysTemperature';
|
||||
$oid = '.1.3.6.1.4.1.7571.100.1.1.5.1.1.1.5';
|
||||
$oids = snmp_get($device, $mib, '-OsqnU', 'SAF-IPRADIO');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
echo 'SAF Temperature ';
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'saf';
|
||||
|
||||
list(,$current) = explode(' ', $oids);
|
||||
$index = $oid;
|
||||
$descr = 'System Temp';
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
19
includes/discovery/sensors/voltages/saf.inc.php
Normal file
19
includes/discovery/sensors/voltages/saf.inc.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'saf') {
|
||||
$oid = '.1.3.6.1.4.1.7571.100.1.1.5.15.1.2.0';
|
||||
$oids = snmp_walk($device, "$oid", '-OsqnU', 'SAF-IPRADIO');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
echo 'SAF Voltage ';
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'saf';
|
||||
|
||||
list(,$current) = explode(' ', $oids);
|
||||
$index = $oid;
|
||||
$descr = 'System voltage';
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
47
includes/polling/mib/saf-mib.inc.php
Normal file
47
includes/polling/mib/saf-mib.inc.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
echo ' SAF Tehnika ';
|
||||
|
||||
$mib_oids = array(
|
||||
'radioRxLevel' => array(
|
||||
'local',
|
||||
'radioRxLevel',
|
||||
'RX Power',
|
||||
'GAUGE',
|
||||
),
|
||||
'radioTxPower' => array(
|
||||
'local',
|
||||
'radioTxPower',
|
||||
'TX Power',
|
||||
'GAUGE',
|
||||
),
|
||||
'modemRadialMSE' => array(
|
||||
'local',
|
||||
'modemRadialMSE',
|
||||
'Radial MSE',
|
||||
'GAUGE',
|
||||
),
|
||||
'modemACMtotalCapacity' => array(
|
||||
'local',
|
||||
'modemACMCapacity',
|
||||
'ACM Capacity',
|
||||
'GAUGE',
|
||||
),
|
||||
'modemTotalCapacity' => array(
|
||||
'local',
|
||||
'modemTotalCapacity',
|
||||
'Capacity',
|
||||
'GAUGE',
|
||||
),
|
||||
);
|
||||
|
||||
$mib_graphs = array(
|
||||
'saf_radioRxLevel',
|
||||
'saf_radioTxPower',
|
||||
'saf_modemRadialMSE',
|
||||
'saf_modemCapacity',
|
||||
);
|
||||
|
||||
unset($graph, $oids, $oid);
|
||||
|
||||
poll_mib_def($device, 'SAF-IPRADIO:saf-modem-radio', 'saf', $mib_oids, $mib_graphs, $graphs);
|
||||
@@ -2,27 +2,22 @@
|
||||
|
||||
if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['type'] == 'wireless') {
|
||||
if ($device['os'] == 'airos') {
|
||||
echo "It Is Airos\n";
|
||||
echo 'It Is Airos' . PHP_EOL;
|
||||
include 'includes/polling/mib/ubnt-airmax-mib.inc.php';
|
||||
}
|
||||
|
||||
if ($device['os'] == 'airos-af') {
|
||||
echo "It Is AirFIBER\n";
|
||||
} else if ($device['os'] == 'airos-af') {
|
||||
echo 'It Is AirFIBER' . PHP_EOL;
|
||||
include 'includes/polling/mib/ubnt-airfiber-mib.inc.php';
|
||||
}
|
||||
|
||||
if ($device['os'] == 'siklu') {
|
||||
echo "It is Siklu\n";
|
||||
} else if ($device['os'] == 'siklu') {
|
||||
echo 'It is Siklu' . PHP_EOL;
|
||||
include 'includes/polling/mib/siklu-mib.inc.php';
|
||||
}
|
||||
|
||||
if ($device['os'] == 'sub10') {
|
||||
echo "It is Sub10\n";
|
||||
} else if ($device['os'] == 'saf') {
|
||||
echo 'It is SAF Tehnika' . PHP_EOL;
|
||||
include 'includes/polling/mib/saf-mib.inc.php';
|
||||
} else if ($device['os'] == 'sub10') {
|
||||
echo 'It is Sub10' . PHP_EOL;
|
||||
include 'includes/polling/mib/sub10-mib.inc.php';
|
||||
}
|
||||
|
||||
// # GENERIC FRAMEWORK, FILLING VARIABLES
|
||||
if ($device['os'] == 'airport') {
|
||||
} else if ($device['os'] == 'airport') {
|
||||
// # GENERIC FRAMEWORK, FILLING VARIABLES
|
||||
echo 'Checking Airport Wireless clients... ';
|
||||
|
||||
$wificlients1 = (snmp_get($device, 'wirelessNumber.0', '-OUqnv', 'AIRPORT-BASESTATION-3-MIB') + 0);
|
||||
@@ -30,25 +25,19 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['ty
|
||||
echo $wificlients1." clients\n";
|
||||
|
||||
// FIXME Also interesting to poll? dhcpNumber.0 for number of active dhcp leases
|
||||
}
|
||||
|
||||
if ($device['os'] == 'ios' and substr($device['hardware'], 0, 4) == 'AIR-' || ($device['os'] == 'ios' && strpos($device['hardware'], 'ciscoAIR') !== false)) {
|
||||
} else if ($device['os'] == 'ios' and substr($device['hardware'], 0, 4) == 'AIR-' || ($device['os'] == 'ios' && strpos($device['hardware'], 'ciscoAIR') !== false)) {
|
||||
echo 'Checking Aironet Wireless clients... ';
|
||||
|
||||
$wificlients1 = snmp_get($device, 'cDot11ActiveWirelessClients.1', '-OUqnv', 'CISCO-DOT11-ASSOCIATION-MIB');
|
||||
$wificlients2 = snmp_get($device, 'cDot11ActiveWirelessClients.2', '-OUqnv', 'CISCO-DOT11-ASSOCIATION-MIB');
|
||||
|
||||
echo (($wificlients1 + 0).' clients on dot11Radio0, '.($wificlients2 + 0)." clients on dot11Radio1\n");
|
||||
}
|
||||
|
||||
if ($device['os'] == 'hpmsm') {
|
||||
} else if ($device['os'] == 'hpmsm') {
|
||||
echo 'Checking HP MSM Wireless clients... ';
|
||||
$wificlients1 = snmp_get($device, '.1.3.6.1.4.1.8744.5.25.1.7.2.0', '-OUqnv');
|
||||
echo $wificlients1." clients\n";
|
||||
}
|
||||
|
||||
// MikroTik RouterOS
|
||||
if ($device['os'] == 'routeros') {
|
||||
} else if ($device['os'] == 'routeros') {
|
||||
// MikroTik RouterOS
|
||||
// Check inventory for wireless card in device. Valid types be here:
|
||||
$wirelesscards = array(
|
||||
'Wireless',
|
||||
@@ -66,9 +55,7 @@ if ($device['type'] == 'network' || $device['type'] == 'firewall' || $device['ty
|
||||
|
||||
unset($wirelesscards);
|
||||
}
|
||||
}
|
||||
|
||||
if ($device['os'] == 'symbol' and (stristr($device['hardware'], 'AP'))) {
|
||||
} else if ($device['os'] == 'symbol' and (stristr($device['hardware'], 'AP'))) {
|
||||
echo 'Checking Symbol Wireless clients... ';
|
||||
|
||||
$wificlients1 = snmp_get($device, '.1.3.6.1.4.1.388.11.2.4.2.100.10.1.18.1', '-Ovq', '""');
|
||||
|
||||
35
mibs/SAF-ENTERPRISE
Executable file
35
mibs/SAF-ENTERPRISE
Executable file
@@ -0,0 +1,35 @@
|
||||
SAF-ENTERPRISE DEFINITIONS ::= BEGIN
|
||||
|
||||
-- Definitions for include by other SAF Tehnika mib modules
|
||||
|
||||
IMPORTS
|
||||
enterprises,
|
||||
MODULE-IDENTITY,
|
||||
OBJECT-IDENTITY FROM SNMPv2-SMI;
|
||||
|
||||
|
||||
-- saf OBJECT IDENTIFIER ::= { enterprises 7571 }
|
||||
saf MODULE-IDENTITY
|
||||
LAST-UPDATED "200704030000Z" -- Apr, 04. 2007
|
||||
ORGANIZATION "SAF Tehnika"
|
||||
CONTACT-INFO
|
||||
"SAF Tehnika technical support
|
||||
<techsupport@saftehnika.com>"
|
||||
DESCRIPTION
|
||||
"SAF Tehnika enterprise spec."
|
||||
::= { enterprises 7571 }
|
||||
|
||||
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 }
|
||||
-- end smiv1
|
||||
|
||||
--
|
||||
END
|
||||
1693
mibs/SAF-IPRADIO
Executable file
1693
mibs/SAF-IPRADIO
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user