Cable Modem Graphs for TopVision OS (#9679)

* Add custom CM Graphs for TopVision OS

* updated test data
This commit is contained in:
djamp42
2019-01-17 12:43:18 -05:00
committed by Tony Murray
parent 5f752361f5
commit 73fa616739
6 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?php
$rrd_filename = rrd_name($device['hostname'], 'topvision_cmoffline');
$ds = 'cmoffline';
$colour_line = '990000';
$colour_area = 'e60000';
$colour_area_max = '9999cc';
$scale_min = '0';
$graph_max = 1;
$graph_min = 0;
$unit_text = 'CM Offline';
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -0,0 +1,18 @@
<?php
$rrd_filename = rrd_name($device['hostname'], 'topvision_cmreg');
$ds = 'cmreg';
$colour_area = '00b33c';
$colour_line = '006622';
$colour_area_max = '9999cc';
$scale_min = '0';
$graph_max = 1;
$graph_min = 0;
$unit_text = 'CM Registered';
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -0,0 +1,18 @@
<?php
$rrd_filename = rrd_name($device['hostname'], 'topvision_cmtotal');
$ds = 'cmtotal';
$colour_area = '9999cc';
$colour_line = '0000cc';
$colour_area_max = '9999cc';
$scale_min = '0';
$graph_max = 1;
$graph_min = 0;
$unit_text = 'CM Total';
require 'includes/graphs/generic_simplex.inc.php';

View File

@@ -530,6 +530,11 @@ $config['graph_types']['device']['asyncos_conns'] = ['section' => 'proxy', 'orde
// Zywall Graphs
$config['graph_types']['device']['zywall_sessions'] = ['section' => 'firewall', 'order' => 0, 'descr' => 'Sessions'];
// TopVision Graphs
$config['graph_types']['device']['topvision_cmtotal'] = ['section' => 'cmts', 'order' => 0, 'descr' => 'Cable Modem Total'];
$config['graph_types']['device']['topvision_cmreg'] = ['section' => 'cmts', 'order' => 1, 'descr' => 'Cable Modem Registered'];
$config['graph_types']['device']['topvision_cmoffline'] = ['section' => 'cmts', 'order' => 2, 'descr' => 'Cable Modem Offline'];
// Device Types
$i = 0;
$config['device_types'][$i]['text'] = 'Servers';

View File

@@ -1,4 +1,6 @@
<?php
use LibreNMS\RRD\RrdDefinition;
$serial = snmp_getnext($device, ".1.3.6.1.4.1.32285.11.1.1.2.1.1.1.16", "-OQv");
preg_match('/hardware version:V([^;]+);software version:V([^;]+);/', $device['sysDescr'], $tv_matches);
@@ -10,3 +12,38 @@ if (isset($tv_matches[1])) {
} else {
$hardware = snmp_getnext($device, ".1.3.6.1.4.1.32285.11.1.1.2.1.1.1.18", "-OQv");
}
$cmstats = snmp_get_multi_oid($device, ['.1.3.6.1.4.1.32285.11.1.1.2.2.3.1.0', '.1.3.6.1.4.1.32285.11.1.1.2.2.3.6.0', '.1.3.6.1.4.1.32285.11.1.1.2.2.3.5.0']);
$cmtotal = $cmstats['.1.3.6.1.4.1.32285.11.1.1.2.2.3.1.0'];
$cmreg = $cmstats['.1.3.6.1.4.1.32285.11.1.1.2.2.3.6.0'];
$cmoffline = $cmstats['.1.3.6.1.4.1.32285.11.1.1.2.2.3.5.0'];
if (is_numeric($cmtotal)) {
$rrd_def = RrdDefinition::make()->addDataset('cmtotal', 'GAUGE', 0);
$fields = array(
'cmtotal' => $cmtotal,
);
$tags = compact('rrd_def');
data_update($device, 'topvision_cmtotal', $tags, $fields);
$graphs['topvision_cmtotal'] = true;
}
if (is_numeric($cmreg)) {
$rrd_def = RrdDefinition::make()->addDataset('cmreg', 'GAUGE', 0);
$fields = array(
'cmreg' => $cmreg,
);
$tags = compact('rrd_def');
data_update($device, 'topvision_cmreg', $tags, $fields);
$graphs['topvision_cmreg'] = true;
}
if (is_numeric($cmoffline)) {
$rrd_def = RrdDefinition::make()->addDataset('cmoffline', 'GAUGE', 0);
$fields = array(
'cmoffline' => $cmoffline,
);
$tags = compact('rrd_def');
data_update($device, 'topvision_cmoffline', $tags, $fields);
$graphs['topvision_cmoffline'] = true;
}

View File

@@ -6,4 +6,7 @@
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.4.1.32285.11.1.1.2.1.1.1.16.142671872|4|1705CC8800D360039
1.3.6.1.4.1.32285.11.1.1.2.1.1.1.18.142671872|4|V2.2.4
1.3.6.1.4.1.32285.11.1.1.2.2.3.1.0|2|114
1.3.6.1.4.1.32285.11.1.1.2.2.3.5.0|2|3
1.3.6.1.4.1.32285.11.1.1.2.2.3.6.0|2|111
1.3.6.1.6.3.10.2.1.3.0|2|62333