mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2797 from BarbarossaTM/issue-386-v2
Ability to use ifIndex,ifName and ifDescr to create and update port rrd files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'-adsl.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'adsl');
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = 'Downstream';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'-adsl.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'adsl');
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = 'Downstream';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'-adsl.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'adsl');
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = 'Downstream';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'-adsl.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'adsl');
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = 'Downstream';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'-adsl.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'adsl');
|
||||
|
||||
$rrd_list[0]['filename'] = $rrd_filename;
|
||||
$rrd_list[0]['descr'] = 'Downstream';
|
||||
|
@@ -13,5 +13,5 @@ if (is_numeric($vars['id']) && ($auth || port_permitted($vars['id']))) {
|
||||
|
||||
$auth = true;
|
||||
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id']);
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ $oids = array(
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('port-'.$port['ifIndex'].'-dot3.rrd');
|
||||
$rrd_filename = get_port_rrdfile_path ($device['hostname'], $port['port_id'], 'dot3');
|
||||
|
||||
if (is_file($rrd_filename)) {
|
||||
foreach ($oids as $oid) {
|
||||
|
@@ -1,15 +1,17 @@
|
||||
<?php
|
||||
|
||||
$rrd_file = get_port_rrdfile_path ($device['hostname'], $port['port_id']);
|
||||
|
||||
// FIXME uhh..
|
||||
if (1) {
|
||||
// $rrd_list[1]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
// $rrd_list[1]['filename'] = $rrd_file;
|
||||
// $rrd_list[1]['descr'] = $int['ifDescr'];
|
||||
// $rrd_list[1]['ds_in'] = "INNUCASTPKTS";
|
||||
// $rrd_list[1]['ds_out'] = "OUTNUCASTPKTS";
|
||||
// $rrd_list[1]['descr'] = "NonUnicast";
|
||||
// $rrd_list[1]['colour_area_in'] = "BB77BB";
|
||||
// $rrd_list[1]['colour_area_out'] = "FFDD88";
|
||||
$rrd_list[2]['filename'] = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'.rrd');
|
||||
$rrd_list[2]['filename'] = $rrd_file;
|
||||
$rrd_list[2]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[2]['ds_in'] = 'INBROADCASTPKTS';
|
||||
$rrd_list[2]['ds_out'] = 'OUTBROADCASTPKTS';
|
||||
@@ -17,7 +19,7 @@ if (1) {
|
||||
$rrd_list[2]['colour_area_in'] = 'aa37BB';
|
||||
$rrd_list[2]['colour_area_out'] = 'ee9D88';
|
||||
|
||||
$rrd_list[4]['filename'] = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'.rrd');
|
||||
$rrd_list[4]['filename'] = $rrd_file;
|
||||
$rrd_list[4]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[4]['ds_in'] = 'INMULTICASTPKTS';
|
||||
$rrd_list[4]['ds_out'] = 'OUTMULTICASTPKTS';
|
||||
@@ -36,8 +38,8 @@ if (1) {
|
||||
|
||||
include 'includes/graphs/generic_multi_seperated.inc.php';
|
||||
}
|
||||
else if (is_file($config['rrd_dir'].'/'.$device['hostname'].'/'.safename($port['ifIndex'].'.rrd'))) {
|
||||
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename($port['ifIndex'].'.rrd');
|
||||
else if (is_file($rrd_file)) {
|
||||
$rrd_filename = $rrd_file;
|
||||
|
||||
$ds_in = 'INNUCASTPKTS';
|
||||
$ds_out = 'OUTNUCASTPKTS';
|
||||
|
@@ -3,8 +3,9 @@
|
||||
// Generate a list of ports and then call the multi_bits grapher to generate from the list
|
||||
$i = 0;
|
||||
foreach (dbFetchRows('SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?', array($port['device_id'], $port['ifIndex'])) as $int) {
|
||||
if (is_file($config['rrd_dir'].'/'.$hostname.'/port-'.safename($int['ifIndex'].'.rrd'))) {
|
||||
$rrd_list[$i]['filename'] = $config['rrd_dir'].'/'.$hostname.'/port-'.safename($int['ifIndex'].'.rrd');
|
||||
$rrd_file = get_port_rrdfile_path ($hostname, int['port_id']);
|
||||
if (is_file($rrd_file)) {
|
||||
$rrd_list[$i]['filename'] = $rrd_file;
|
||||
$rrd_list[$i]['descr'] = $int['ifDescr'];
|
||||
$i++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user