mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added discovery and graphing for JunOS (SRX) RPM probes (#11187)
* Added discovery and graphing for JunOS (SRX) RPM probes * Proposed changes for a percent based sensor type * Fixed missing MIB declaration in JunOS YAML discovery file * Updated Health-information.md to reflect the new percentage value type * Added separate test data for junos_rpm type * Update sensors.php * Update sensors.php * Update functions.inc.php * test re-run * Update junos_rpm.json * percentage -> loss * add ifSpeed prev test data * mis-merge * update sensors * and bgp... Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com> Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ class Sensor extends DeviceRelatedModel
|
||||
'frequency' => 'line-chart',
|
||||
'humidity' => 'tint',
|
||||
'load' => 'percent',
|
||||
'loss' => 'percentage',
|
||||
'power' => 'power-off',
|
||||
'power_consumed' => 'plug',
|
||||
'power_factor' => 'calculator',
|
||||
|
@@ -25,6 +25,7 @@ the values we expect to see the data in:
|
||||
| frequency | Hz |
|
||||
| humidity | % |
|
||||
| load | % |
|
||||
| loss | % |
|
||||
| power | W |
|
||||
| power_consumed | kWh |
|
||||
| power_factor | ratio |
|
||||
|
@@ -1,4 +1,4 @@
|
||||
mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB:JUNIPER-MIB:JUNIPER-SRX5000-SPU-MONITORING-MIB:JUNIPER-ALARM-MIB:JUNIPER-VIRTUALCHASSIS-MIB
|
||||
mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB:JUNIPER-MIB:JUNIPER-SRX5000-SPU-MONITORING-MIB:JUNIPER-ALARM-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-RPM-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
@@ -118,6 +118,17 @@ modules:
|
||||
divisor: 1000
|
||||
descr: '{{ $ifDescr }} Tx Bias'
|
||||
index: 'jnxPMCurTxLaserBiasCurrent.{{ $index }}'
|
||||
loss:
|
||||
data:
|
||||
-
|
||||
oid: jnxRpmResultsSummaryTable
|
||||
value: jnxRpmResSumPercentLost
|
||||
num_oid: '.1.3.6.1.4.1.2636.3.50.1.2.1.{{ $index_string }}'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
group: RPM Probes
|
||||
entPhysicalIndex_measured: 'probes'
|
||||
descr: '{{ $index }} Probe Loss'
|
||||
index: 'jnxRpmResSumPercentLost.{{ $index }}'
|
||||
count:
|
||||
data:
|
||||
-
|
||||
|
@@ -51,6 +51,7 @@ $run_sensors = array(
|
||||
'frequency',
|
||||
'humidity',
|
||||
'load',
|
||||
'loss',
|
||||
'power',
|
||||
'power_consumed',
|
||||
'power_factor',
|
||||
|
6
includes/html/graphs/device/loss.php
Normal file
6
includes/html/graphs/device/loss.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$class = 'loss';
|
||||
$unit = '%';
|
||||
$unit_long = 'Percentage';
|
||||
|
||||
require 'includes/html/graphs/device/sensor.inc.php';
|
23
includes/html/graphs/sensor/loss.inc.php
Normal file
23
includes/html/graphs/sensor/loss.inc.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= " COMMENT:' Min Last Max\\n'";
|
||||
|
||||
$sensor['sensor_descr_fixed'] = rrdtool_escape($sensor['sensor_descr'], 15);
|
||||
|
||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
|
||||
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".$sensor['sensor_descr_fixed']."'";
|
||||
$rrd_options .= " GPRINT:sensor_min$current_id:MIN:%4.1lf";
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%4.1lf';
|
||||
$rrd_options .= ' GPRINT:sensor_max:MAX:%4.1lf\\l';
|
||||
|
||||
if (is_numeric($sensor['sensor_limit'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit'].'#999999::dashes';
|
||||
}
|
||||
|
||||
if (is_numeric($sensor['sensor_limit_low'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit_low'].'#999999::dashes';
|
||||
}
|
@@ -32,6 +32,7 @@ $dBm = dbFetchCell("select count(*) from sensors WHERE sensor_
|
||||
$states = dbFetchCell("select count(*) from sensors WHERE sensor_class='state' AND device_id = ?", array($device['device_id']));
|
||||
$charge = dbFetchCell("select count(*) from sensors WHERE sensor_class='charge' AND device_id = ?", array($device['device_id']));
|
||||
$load = dbFetchCell("select count(*) from sensors WHERE sensor_class='load' AND device_id = ?", array($device['device_id']));
|
||||
$loss = dbFetchCell("select count(*) from sensors WHERE sensor_class='loss' AND device_id = ?", array($device['device_id']));
|
||||
$signal = dbFetchCell("select count(*) from sensors WHERE sensor_class='signal' AND device_id = ?", array($device['device_id']));
|
||||
$airflow = dbFetchCell("select count(*) from sensors WHERE sensor_class='airflow' AND device_id = ?", array($device['device_id']));
|
||||
$snr = dbFetchCell("select count(*) from sensors WHERE sensor_class='snr' AND device_id = ?", array($device['device_id']));
|
||||
@@ -170,6 +171,10 @@ if ($waterflow) {
|
||||
$datas[] = 'waterflow';
|
||||
}
|
||||
|
||||
if ($loss) {
|
||||
$datas[] = 'loss';
|
||||
}
|
||||
|
||||
$type_text['overview'] = 'Overview';
|
||||
$type_text['charge'] = 'Battery Charge';
|
||||
$type_text['temperature'] = 'Temperature';
|
||||
@@ -201,6 +206,7 @@ $type_text['chromatic_dispersion'] = 'Chromatic Dispersion';
|
||||
$type_text['ber'] = 'Bit Error Rate';
|
||||
$type_text['eer'] = 'Energy Efficiency Ratio';
|
||||
$type_text['waterflow'] = 'Water Flow Rate';
|
||||
$type_text['loss'] = 'Loss';
|
||||
$type_text['qfp'] = 'QFP';
|
||||
|
||||
$link_array = array(
|
||||
|
7
includes/html/pages/device/health/loss.inc.php
Normal file
7
includes/html/pages/device/health/loss.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'loss';
|
||||
$unit = '%';
|
||||
$graph_type = 'sensor_loss';
|
||||
|
||||
require 'sensors.inc.php';
|
@@ -64,6 +64,7 @@ require 'overview/sensors/chromatic_dispersion.inc.php';
|
||||
require 'overview/sensors/ber.inc.php';
|
||||
require 'overview/sensors/eer.inc.php';
|
||||
require 'overview/sensors/waterflow.inc.php';
|
||||
require 'overview/sensors/loss.inc.php';
|
||||
require 'overview/eventlog.inc.php';
|
||||
require 'overview/services.inc.php';
|
||||
require 'overview/syslog.inc.php';
|
||||
|
8
includes/html/pages/device/overview/sensors/loss.inc.php
Normal file
8
includes/html/pages/device/overview/sensors/loss.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_loss';
|
||||
$sensor_class = 'loss';
|
||||
$sensor_unit = '%';
|
||||
$sensor_type = 'loss';
|
||||
|
||||
require 'includes/html/pages/device/overview/generic/sensor.inc.php';
|
@@ -45,6 +45,7 @@ $type_text = [
|
||||
'power_factor' => "Power Factor",
|
||||
'dbm' => "dBm",
|
||||
'load' => "Load",
|
||||
'loss' => 'Loss',
|
||||
'state' => "State",
|
||||
'count' => "Count",
|
||||
'signal' => "Signal",
|
||||
|
7
includes/html/pages/health/loss.inc.php
Normal file
7
includes/html/pages/health/loss.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_loss';
|
||||
$class = 'loss';
|
||||
$unit = '%';
|
||||
|
||||
require 'includes/html/pages/health/sensors.inc.php';
|
@@ -96,6 +96,12 @@ return [
|
||||
'unit' => '%',
|
||||
'unit_long' => 'Percent',
|
||||
],
|
||||
'loss' => [
|
||||
'short' => 'Percent',
|
||||
'long' => 'Loss Percentage',
|
||||
'unit' => '%',
|
||||
'unit_long' => 'percentage',
|
||||
],
|
||||
'power' => [
|
||||
'short' => 'Power',
|
||||
'long' => 'Power',
|
||||
|
13973
tests/data/junos_rpm.json
Normal file
13973
tests/data/junos_rpm.json
Normal file
File diff suppressed because it is too large
Load Diff
3635
tests/snmpsim/junos_rpm.snmprec
Normal file
3635
tests/snmpsim/junos_rpm.snmprec
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user