mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Add addition riverbed information #5170
This commit is contained in:
58
html/includes/graphs/device/riverbed_connections.inc.php
Normal file
58
html/includes/graphs/device/riverbed_connections.inc.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 crcro
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
$rrd_filename = rrd_name($device['hostname'], 'riverbed_connections');
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = 'mixed';
|
||||
$unit_text = 'Connections';
|
||||
$unitlen = 10;
|
||||
$bigdescrlen = 15;
|
||||
$smalldescrlen = 15;
|
||||
$dostack = 0;
|
||||
$printtotal = 0;
|
||||
$addarea = 1;
|
||||
$transparency = 80;
|
||||
$data_sources = array(
|
||||
'half_open' => array('descr' => 'Half open','colour' => '66873e',),
|
||||
'half_closed' => array('descr' => 'Half closed','colour' => 'f49842',),
|
||||
'established' => array('descr' => 'Established','colour' => '438099',),
|
||||
'closed' => array('descr' => 'Closed','colour' => 'af2121',),
|
||||
'total' => array('descr' => 'Total','colour' => '000000',)
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $vars) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_v3_multiline.inc.php';
|
56
html/includes/graphs/device/riverbed_datastore.inc.php
Normal file
56
html/includes/graphs/device/riverbed_datastore.inc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 crcro
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
$rrd_filename = rrd_name($device['hostname'], 'riverbed_datastore');
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = 'mixed';
|
||||
$unit_text = 'Datastore';
|
||||
$unitlen = 10;
|
||||
$bigdescrlen = 15;
|
||||
$smalldescrlen = 15;
|
||||
$dostack = 0;
|
||||
$printtotal = 0;
|
||||
$addarea = 1;
|
||||
$transparency = 80;
|
||||
$data_sources = array(
|
||||
'datastore_hits' => array('descr' => 'Hits','colour' => '438099',),
|
||||
'datastore_miss' => array('descr' => 'Miss','colour' => 'af2121',)
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $vars) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_v3_multiline.inc.php';
|
55
html/includes/graphs/device/riverbed_optimization.inc.php
Normal file
55
html/includes/graphs/device/riverbed_optimization.inc.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 crcro
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
$rrd_filename = rrd_name($device['hostname'], 'riverbed_optimization');
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = 'mixed';
|
||||
$unit_text = 'Optimized connections';
|
||||
$unitlen = 10;
|
||||
$bigdescrlen = 15;
|
||||
$smalldescrlen = 15;
|
||||
$dostack = 0;
|
||||
$printtotal = 0;
|
||||
$addarea = 1;
|
||||
$transparency = 80;
|
||||
$data_sources = array(
|
||||
'conn_optimized' => array('descr' => 'Optimized','colour' => '438099',),
|
||||
'conn_passthrough' => array('descr' => 'Passthrough','colour' => 'af2121',)
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $vars) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_v3_multiline.inc.php';
|
56
html/includes/graphs/device/riverbed_passthrough.inc.php
Normal file
56
html/includes/graphs/device/riverbed_passthrough.inc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 crcro
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
$rrd_filename = rrd_name($device['hostname'], 'riverbed_passthrough');
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = 'mixed';
|
||||
$unit_text = 'Bandwidth Passthrough';
|
||||
$unitlen = 10;
|
||||
$bigdescrlen = 15;
|
||||
$smalldescrlen = 15;
|
||||
$dostack = 0;
|
||||
$printtotal = 0;
|
||||
$addarea = 1;
|
||||
$transparency = 80;
|
||||
$data_sources = array(
|
||||
'bw_in' => array('descr' => 'In','colour' => '30649b',),
|
||||
'bw_out' => array('descr' => 'Out','colour' => '9b3030',),
|
||||
'bw_total' => array('descr' => 'Total', 'colour' => '000000',)
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $vars) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $vars['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $rrd_filename";
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_v3_multiline_float.inc.php';
|
@@ -574,6 +574,19 @@ $config['graph_types']['device']['sgos_average_requests']['section'] = 'network
|
||||
$config['graph_types']['device']['sgos_average_requests']['order'] = '0';
|
||||
$config['graph_types']['device']['sgos_average_requests']['descr'] = 'Average HTTP Requests';
|
||||
|
||||
//riverbed specific graphs
|
||||
$config['graph_types']['device']['riverbed_connections']['section'] = 'network';
|
||||
$config['graph_types']['device']['riverbed_connections']['order'] = 0;
|
||||
$config['graph_types']['device']['riverbed_connections']['descr'] = 'Connections';
|
||||
$config['graph_types']['device']['riverbed_optimization']['section'] = 'network';
|
||||
$config['graph_types']['device']['riverbed_optimization']['order'] = 1;
|
||||
$config['graph_types']['device']['riverbed_optimization']['descr'] = 'Optimization';
|
||||
$config['graph_types']['device']['riverbed_datastore']['section'] = 'network';
|
||||
$config['graph_types']['device']['riverbed_datastore']['order'] = 2;
|
||||
$config['graph_types']['device']['riverbed_datastore']['descr'] = 'Data store productivity';
|
||||
$config['graph_types']['device']['riverbed_passthrough']['section'] = 'network';
|
||||
$config['graph_types']['device']['riverbed_passthrough']['order'] = 3;
|
||||
$config['graph_types']['device']['riverbed_passthrough']['descr'] = 'Bandwidth Passthrough';
|
||||
|
||||
// Device Types
|
||||
$i = 0;
|
||||
|
@@ -4,6 +4,7 @@ type: network
|
||||
icon: riverbed
|
||||
over:
|
||||
- { graph: device_bits, text: Traffic }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
discovery:
|
||||
- sysObjectId:
|
||||
- .1.3.6.1.4.1.17163.1.1
|
||||
|
43
includes/discovery/processors/riverbed.inc.php
Normal file
43
includes/discovery/processors/riverbed.inc.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 crcro
|
||||
* @author Cercel Valentin <crc@nuamchefazi.ro>
|
||||
*
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'riverbed') {
|
||||
//enterprises.rbt.products.steelhead.statistics.cpuLoad.cpuUtil1.0
|
||||
$cpu_oid = '.1.3.6.1.4.1.17163.1.1.5.1.4.0';
|
||||
d_echo('Riverbed processor');
|
||||
$descr = 'Processor';
|
||||
$usage = snmp_get($device, $cpu_oid, '-OUQn');
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor(
|
||||
$valid['processor'],
|
||||
$device,
|
||||
'.1.3.6.1.4.1.17163.1.1.5.1.4.0',
|
||||
'0',
|
||||
'riverbed-cpu',
|
||||
$descr,
|
||||
'100',
|
||||
$usage,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
@@ -3,6 +3,7 @@
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* Copyright (c) 2017 Cercel Valentin <crc@nuamchefazi.ro>
|
||||
* 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
|
||||
@@ -12,3 +13,156 @@
|
||||
$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.1.0', '-OQv'), '"');
|
||||
$serial = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.2.0', '-OQv'), '"');
|
||||
$version = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.3.0', '-OQv'), '"');
|
||||
|
||||
|
||||
/* optimisation oids
|
||||
*
|
||||
* half-open .1.3.6.1.4.1.17163.1.1.5.2.3.0
|
||||
* half-closed .1.3.6.1.4.1.17163.1.1.5.2.4.0
|
||||
* establised .1.3.6.1.4.1.17163.1.1.5.2.5.0
|
||||
* active .1.3.6.1.4.1.17163.1.1.5.2.6.0
|
||||
* total .1.3.6.1.4.1.17163.1.1.5.2.7.0
|
||||
*
|
||||
*/
|
||||
|
||||
$conn_array = array(
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.3.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.4.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.5.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.6.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.7.0',
|
||||
);
|
||||
$connections = snmp_get_multi_oid($device, $conn_array);
|
||||
|
||||
$conn_half_open = $connections['.1.3.6.1.4.1.17163.1.1.5.2.3.0'];
|
||||
$conn_half_closed = $connections['.1.3.6.1.4.1.17163.1.1.5.2.4.0'];
|
||||
$conn_established = $connections['.1.3.6.1.4.1.17163.1.1.5.2.5.0'];
|
||||
$conn_active = $connections['.1.3.6.1.4.1.17163.1.1.5.2.6.0'];
|
||||
$conn_total = $connections['.1.3.6.1.4.1.17163.1.1.5.2.7.0'];
|
||||
|
||||
if ($conn_half_open >= 0 && $conn_half_closed >= 0 && $conn_established >= 0 && $conn_active >= 0 && $conn_total >= 0) {
|
||||
$rrd_def = array(
|
||||
'DS:half_open:GAUGE:600:0:U',
|
||||
'DS:half_closed:GAUGE:600:0:U',
|
||||
'DS:established:GAUGE:600:0:U',
|
||||
'DS:active:GAUGE:600:0:U',
|
||||
'DS:total:GAUGE:600:0:U',
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'half_open' => $conn_half_open,
|
||||
'half_closed' => $conn_half_closed,
|
||||
'established' => $conn_established,
|
||||
'active' => $conn_established,
|
||||
'total' => $conn_total,
|
||||
);
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
|
||||
data_update($device, 'riverbed_connections', $tags, $fields);
|
||||
$graphs['riverbed_connections'] = true;
|
||||
}
|
||||
|
||||
/* datastore oids
|
||||
*
|
||||
* hits .1.3.6.1.4.1.17163.1.1.5.4.1.0
|
||||
* miss .1.3.6.1.4.1.17163.1.1.5.4.2.0
|
||||
*
|
||||
*/
|
||||
$datastore_array = array(
|
||||
'.1.3.6.1.4.1.17163.1.1.5.4.1.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.4.2.0',
|
||||
);
|
||||
$datastore = snmp_get_multi_oid($device, $conn_array);
|
||||
|
||||
$datastore_hits = $datastore['.1.3.6.1.4.1.17163.1.1.5.4.1.0'];
|
||||
$datastore_miss = $datastore['.1.3.6.1.4.1.17163.1.1.5.4.2.0'];
|
||||
|
||||
if ($datastore_hits >= 0 && $datastore_miss >= 0) {
|
||||
$rrd_def = array(
|
||||
'DS:datastore_hits:GAUGE:600:0:U',
|
||||
'DS:datastore_miss:GAUGE:600:0:U',
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'datastore_hits' => $datastore_hits,
|
||||
'datastore_miss' => $datastore_miss,
|
||||
);
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
|
||||
data_update($device, 'riverbed_datastore', $tags, $fields);
|
||||
$graphs['riverbed_datastore'] = true;
|
||||
}
|
||||
|
||||
/* optimization oids
|
||||
*
|
||||
* optimized .1.3.6.1.4.1.17163.1.1.5.2.1.0
|
||||
* passthrough .1.3.6.1.4.1.17163.1.1.5.2.2.0
|
||||
*
|
||||
*/
|
||||
$optimization_array = array(
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.1.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.2.2.0',
|
||||
);
|
||||
|
||||
$optimizations = snmp_get_multi_oid($device, $optimization_array);
|
||||
|
||||
$conn_optimized = $optimizations['.1.3.6.1.4.1.17163.1.1.5.2.1.0'];
|
||||
$conn_passthrough = $optimizations['.1.3.6.1.4.1.17163.1.1.5.2.2.0'];
|
||||
|
||||
if ($conn_optimized >= 0 && $conn_passthrough >= 0) {
|
||||
$rrd_def = array(
|
||||
'DS:conn_optimized:GAUGE:600:0:U',
|
||||
'DS:conn_passthrough:GAUGE:600:0:U',
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'conn_optimized' => $conn_optimized,
|
||||
'conn_passthrough' => $conn_passthrough,
|
||||
);
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
|
||||
data_update($device, 'riverbed_optimisation', $tags, $fields);
|
||||
$graphs['riverbed_optimisation'] = true;
|
||||
}
|
||||
|
||||
/* bandwidth passthrough
|
||||
*
|
||||
* in .1.3.6.1.4.1.17163.1.1.5.3.3.1.0
|
||||
* out .1.3.6.1.4.1.17163.1.1.5.3.3.2.0
|
||||
* total .1.3.6.1.4.1.17163.1.1.5.3.3.3.0
|
||||
*
|
||||
*/
|
||||
|
||||
$bandwidth_array = array(
|
||||
'.1.3.6.1.4.1.17163.1.1.5.3.3.1.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.3.3.2.0',
|
||||
'.1.3.6.1.4.1.17163.1.1.5.3.3.3.0',
|
||||
);
|
||||
|
||||
$bandwidth = snmp_get_multi_oid($device, $bandwidth_array);
|
||||
|
||||
$bw_in = $bandwidth['.1.3.6.1.4.1.17163.1.1.5.3.3.1.0'];
|
||||
$bw_out = $bandwidth['.1.3.6.1.4.1.17163.1.1.5.3.3.2.0'];
|
||||
$bw_total = $bandwidth['.1.3.6.1.4.1.17163.1.1.5.3.3.3.0'];
|
||||
|
||||
if ($bw_in >= 0 && $bw_out >= 0 && $bw_total >= 0) {
|
||||
$rrd_def = array(
|
||||
'DS:bw_in:GAUGE:600:0:U',
|
||||
'DS:bw_out:GAUGE:600:0:U',
|
||||
'DS:bw_total:GAUGE:600:0:U',
|
||||
);
|
||||
|
||||
$fields = array(
|
||||
'bw_in' => $bw_in,
|
||||
'bw_out' => $bw_out,
|
||||
'bw_total' => $bw_total,
|
||||
);
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
|
||||
data_update($device, 'riverbed_passthrough', $tags, $fields);
|
||||
$graphs['riverbed_passthrough'] = true;
|
||||
}
|
||||
|
4
sql-schema/155.sql
Normal file
4
sql-schema/155.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'riverbed_connections', 'network', 'Connections', '');
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'riverbed_optimization', 'network', 'Optimization', '');
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'riverbed_datastore', 'network', 'Datastore productivity', '');
|
||||
INSERT INTO `graph_types`(`graph_type`, `graph_subtype`, `graph_section`, `graph_descr`, `graph_order`) VALUES ('device', 'riverbed_passthrough', 'network', 'Bandwidth passthrough', '');
|
Reference in New Issue
Block a user