mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
allow inversion of individual ports with multiporT_bits graphtype via ! (universal at some point)
git-svn-id: http://www.observium.org/svn/observer/trunk@1925 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -6,11 +6,10 @@
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach ($rrd_filenames as $rrd_filename)
|
||||
{
|
||||
$rrd_options .= " DEF:inoctets" . $i . "=".$rrd_filename.":".$rra_in.":AVERAGE";
|
||||
$rrd_options .= " DEF:outoctets" . $i . "=".$rrd_filename.":".$rra_out.":AVERAGE";
|
||||
foreach($rrd_filenames as $key => $rrd_filename) {
|
||||
if($rrd_inverted[$key]) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||
$rrd_options .= " DEF:".$in."octets" . $i . "=".$rrd_filename.":".$rra_in.":AVERAGE";
|
||||
$rrd_options .= " DEF:".$out."octets" . $i . "=".$rrd_filename.":".$rra_out.":AVERAGE";
|
||||
$in_thing .= $seperator . "inoctets" . $i . ",UN,0," . "inoctets" . $i . ",IF";
|
||||
$out_thing .= $seperator . "outoctets" . $i . ",UN,0," . "outoctets" . $i . ",IF";
|
||||
$pluses .= $plus;
|
||||
|
@ -4,11 +4,17 @@ $i = 1;
|
||||
|
||||
foreach (explode(",", $id) as $ifid)
|
||||
{
|
||||
if(strstr($ifid, "!"))
|
||||
{
|
||||
$rrd_inverted[$i] = TRUE;
|
||||
$ifid = str_replace("!", "", $ifid);
|
||||
}
|
||||
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . $ifid . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . safename($int[0] . ".rrd")))
|
||||
{
|
||||
$rrd_filenames[] = $config['rrd_dir'] . "/" . $int[1] . "/port-" . safename($int[0] . ".rrd");
|
||||
$rrd_filenames[$i] = $config['rrd_dir'] . "/" . $int[1] . "/port-" . safename($int[0] . ".rrd");
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user