mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
moar graph cleanups
git-svn-id: http://www.observium.org/svn/observer/trunk@1906 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -10,7 +10,6 @@ if(is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || bill_permitted(
|
||||
AND D.device_id = P.device_id");
|
||||
|
||||
$auth = TRUE;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,8 +3,11 @@
|
||||
## Generate a list of ports and then call the multi_bits grapher to generate from the list
|
||||
|
||||
$i = 0;
|
||||
while($port = mysql_fetch_array($ports)) {
|
||||
if(is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd"))) {
|
||||
|
||||
while ($port = mysql_fetch_array($ports))
|
||||
{
|
||||
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
|
||||
{
|
||||
$rrd_list[$i]['filename'] = $config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
$rrd_list[$i]['descr'] = $port['ifDescr'];
|
||||
$i++;
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
## Generate a list of ports and then call the multi_bits grapher to generate from the list
|
||||
|
||||
$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = '".mres($_GET['id'])."' AND D.device_id = I.device_id");
|
||||
while($int = mysql_fetch_array($query)) {
|
||||
if(is_file($config['rrd_dir'] . "/" . $int['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd"))) {
|
||||
while ($int = mysql_fetch_array($query))
|
||||
{
|
||||
if (is_file($config['rrd_dir'] . "/" . $int['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd")))
|
||||
{
|
||||
$rrd_filenames[] = $config['rrd_dir'] . "/" . $int['hostname'] . "/port-" . safename($int['ifIndex'] . ".rrd");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/cipsec_flow.rrd";
|
||||
@@ -39,8 +38,6 @@ $rrd_list[$i]['descr'] = "OutDrops";
|
||||
$rrd_list[$i]['rra'] = "OutDrops";
|
||||
$rra_list[$i]['invert'] = "1";
|
||||
|
||||
|
||||
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = "InAuthFail";
|
||||
@@ -74,7 +71,6 @@ $rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = "SysCapFails";
|
||||
$rrd_list[$i]['rra'] = "SysCapFails";
|
||||
|
||||
|
||||
#$units='%';
|
||||
#$total_units='%';
|
||||
$colours='mixed';
|
||||
@@ -86,5 +82,4 @@ $nototal = 1;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/cipsec_flow.rrd";
|
||||
@@ -18,6 +17,4 @@ $unit_text = "Active Tunnels";
|
||||
|
||||
include("includes/graphs/generic_simplex.inc.php");
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
#$device = device_by_id_cache($id);
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
@@ -19,7 +18,6 @@ $rrd_list[2]['filename'] = $file;
|
||||
$rrd_list[2]['descr'] = "Failed";
|
||||
$rrd_list[2]['rra'] = "failed";
|
||||
|
||||
|
||||
if ($_GET['debug']) { print_r($rrd_list); }
|
||||
|
||||
$colours = "mixed";
|
||||
@@ -27,9 +25,6 @@ $nototal = 1;
|
||||
$unit_text = "Sessions";
|
||||
$scale_min = "0";
|
||||
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -10,6 +10,7 @@ $device = device_by_id_cache($id);
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM storage where device_id = '$id'");
|
||||
$rrd_options .= " COMMENT:' Size Used %age\\l'";
|
||||
|
||||
while ($storage = mysql_fetch_array($sql))
|
||||
{
|
||||
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename_in = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssIORawReceived.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssIORawSent.rrd";
|
||||
$rra_in = "value";
|
||||
@@ -10,5 +9,4 @@ $multiplier = 512;
|
||||
|
||||
include("includes/graphs/generic_bits.inc.php");
|
||||
|
||||
|
||||
?>
|
||||
@@ -29,5 +29,4 @@ $device = device_by_id_cache($id);
|
||||
$rrd_options .= " GPRINT:c:AVERAGE:\ \ %7.2lf";
|
||||
$rrd_options .= " GPRINT:c:MAX:\ \ %7.2lf\\\\n";
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
$rrd_filename_in = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawSwapIn.rrd";
|
||||
$rrd_filename_out = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawSwapOut.rrd";
|
||||
$rra_in = "value";
|
||||
@@ -10,5 +9,4 @@ $multiplier = 512;
|
||||
|
||||
include("includes/graphs/generic_bits.inc.php");
|
||||
|
||||
|
||||
?>
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
if (is_numeric($id))
|
||||
{
|
||||
|
||||
$query = mysql_query("SELECT * FROM `ucd_diskio` AS U, `devices` AS D WHERE U.diskio_id = '".$id."' AND U.device_id = D.device_id");
|
||||
$disk = mysql_fetch_array($query);
|
||||
|
||||
@@ -18,7 +17,4 @@ if(is_numeric($id))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -5,7 +5,9 @@ if($_GET['id']) { $id = $_GET['id']; }
|
||||
$query = mysql_query("SELECT * FROM `ucd_diskio` AS U, `devices` AS D WHERE U.diskio_id = '".$id."' AND U.device_id = D.device_id");
|
||||
|
||||
$disk = mysql_fetch_array($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $disk['hostname'] . "/ucd_diskio-" . safename($disk['diskio_descr'] . ".rrd"))) {
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $disk['hostname'] . "/ucd_diskio-" . safename($disk['diskio_descr'] . ".rrd")))
|
||||
{
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $disk['hostname'] . "/ucd_diskio-" . safename($disk['diskio_descr'] . ".rrd");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
$auth = TRUE;
|
||||
|
||||
foreach(explode(",", $id) as $ifid) {
|
||||
foreach (explode(",", $id) as $ifid)
|
||||
{
|
||||
if (!$config['allow_unauth_graphs'] && !port_permitted($ifid))
|
||||
$auth = FALSE;
|
||||
}
|
||||
@@ -17,5 +18,4 @@ foreach(explode(",", $id) as $ifid) {
|
||||
|
||||
$title = "Multi Port :: ";
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
|
||||
$i = 1;
|
||||
foreach(explode(",", $id) as $ifid) {
|
||||
|
||||
foreach (explode(",", $id) as $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"))) {
|
||||
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");
|
||||
$i++;
|
||||
}
|
||||
@@ -21,5 +23,4 @@ $colour_area_out = "C3D9FF";
|
||||
|
||||
include("includes/graphs/generic_multi_bits.inc.php");
|
||||
|
||||
|
||||
?>
|
||||
@@ -7,10 +7,12 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
if ($height < "99") { $rrd_options .= " --only-graph"; }
|
||||
$i = 1;
|
||||
|
||||
foreach(explode(",", $_GET['id']) as $ifid) {
|
||||
foreach (explode(",", $_GET['id']) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd"))
|
||||
{
|
||||
$rrd_options .= " DEF:inoctets" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:INOCTETS:AVERAGE";
|
||||
$rrd_options .= " DEF:outoctets" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:OUTOCTETS:AVERAGE";
|
||||
$in_thing .= $seperator . "inoctets" . $i . ",UN,0," . "inoctets" . $i . ",IF";
|
||||
@@ -22,10 +24,13 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
}
|
||||
}
|
||||
unset($seperator); unset($plus);
|
||||
foreach(explode(",", $_GET['idb']) as $ifid) {
|
||||
|
||||
foreach (explode(",", $_GET['idb']) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd"))
|
||||
{
|
||||
$rrd_options .= " DEF:inoctetsb" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:INOCTETS:AVERAGE";
|
||||
$rrd_options .= " DEF:outoctetsb" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:OUTOCTETS:AVERAGE";
|
||||
$in_thingb .= $seperator . "inoctetsb" . $i . ",UN,0," . "inoctetsb" . $i . ",IF";
|
||||
@@ -36,6 +41,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
|
||||
$rrd_options .= " CDEF:".$in."octets=" . $in_thing . $pluses;
|
||||
$rrd_options .= " CDEF:".$out."octets=" . $out_thing . $pluses;
|
||||
@@ -53,7 +59,9 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$rrd_options .= " CDEF:outbits_tot=outbits,outbitsb,+";
|
||||
$rrd_options .= " CDEF:doutbits_tot=outbits_tot,-1,*";
|
||||
$rrd_options .= " CDEF:nothing=outbits_tot,outbits_tot,-";
|
||||
if($legend == "no") {
|
||||
|
||||
if ($legend == "no")
|
||||
{
|
||||
$rrd_options .= " AREA:inbits_tot#cdeb8b:";
|
||||
$rrd_options .= " AREA:inbits#ffcc99:";
|
||||
$rrd_options .= " AREA:doutbits_tot#C3D9FF:";
|
||||
@@ -109,8 +117,8 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$rrd_options .= " LINE1.25:inbits_tot#006600:";
|
||||
$rrd_options .= " LINE1.25:doutbits_tot#000099:";
|
||||
$rrd_options .= " LINE0.5:nothing#555555:";
|
||||
|
||||
}
|
||||
|
||||
if ($width <= "300") { $rrd_options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal"; }
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
$i = 0;
|
||||
foreach(explode(",", $id) as $ifid) {
|
||||
|
||||
foreach (explode(",", $id) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT * FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$port = mysql_fetch_array($query);
|
||||
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
|
||||
|
||||
@@ -4,12 +4,16 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
|
||||
$rrd_options = " --alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
|
||||
$rrd_options .= $config['rrdgraph_def_text'];
|
||||
|
||||
if ($height < "99") { $rrd_options .= " --only-graph"; }
|
||||
$i = 1;
|
||||
foreach(explode(",", $_GET['id']) as $ifid) {
|
||||
|
||||
foreach (explode(",", $_GET['id']) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd"))
|
||||
{
|
||||
if (strstr($inverse, "a")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; }
|
||||
$rrd_options .= " DEF:inoctets" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$in."OCTETS:AVERAGE";
|
||||
$rrd_options .= " DEF:outoctets" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$out."OCTETS:AVERAGE";
|
||||
@@ -21,11 +25,15 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
unset($seperator); unset($plus);
|
||||
foreach(explode(",", $_GET['idb']) as $ifid) {
|
||||
|
||||
foreach (explode(",", $_GET['idb']) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd"))
|
||||
{
|
||||
if (strstr($inverse, "b")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; }
|
||||
$rrd_options .= " DEF:inoctetsb" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$in."OCTETS:AVERAGE";
|
||||
$rrd_options .= " DEF:outoctetsb" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$out."OCTETS:AVERAGE";
|
||||
@@ -37,11 +45,15 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
unset($seperator); unset($plus);
|
||||
foreach(explode(",", $_GET['idc']) as $ifid) {
|
||||
|
||||
foreach (explode(",", $_GET['idc']) as $ifid)
|
||||
{
|
||||
$query = mysql_query("SELECT `ifIndex`, `hostname` FROM `ports` AS I, devices as D WHERE I.interface_id = '" . mres($ifid) . "' AND I.device_id = D.device_id");
|
||||
$int = mysql_fetch_row($query);
|
||||
if(is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd"))
|
||||
{
|
||||
if (strstr($inverse, "c")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; }
|
||||
$rrd_options .= " DEF:inoctetsc" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$in."OCTETS:AVERAGE";
|
||||
$rrd_options .= " DEF:outoctetsc" . $i . "=" . $config['rrd_dir'] . "/" . $int[1] . "/port-" . $int[0] . ".rrd:".$out."OCTETS:AVERAGE";
|
||||
@@ -53,6 +65,7 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$rrd_options .= " CDEF:inoctets=" . $in_thing . $pluses;
|
||||
$rrd_options .= " CDEF:outoctets=" . $out_thing . $pluses;
|
||||
$rrd_options .= " CDEF:inoctetsb=" . $in_thingb . $plusesb;
|
||||
@@ -79,7 +92,8 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$rrd_options .= " CDEF:doutbits_tot=outbits_tot,-1,*";
|
||||
$rrd_options .= " CDEF:nothing=outbits_tot,outbits_tot,-";
|
||||
|
||||
if($legend == "no") {
|
||||
if ($legend == "no")
|
||||
{
|
||||
$rrd_options .= " AREA:inbits_tot#cdeb8b:";
|
||||
$rrd_options .= " AREA:doutbits_tot#cdeb8b:";
|
||||
$rrd_options .= " LINE1.25:inbits_tot#aacc77:";
|
||||
@@ -154,9 +168,8 @@ if($_GET['legend']) { $legend = $_GET['legend']; }
|
||||
$rrd_options .= " GPRINT:outbits_tot:AVERAGE:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:outbits_tot:MIN:%6.2lf%s";
|
||||
$rrd_options .= " GPRINT:outbits_tot:MAX:%6.2lf%s\\\\l";
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($width <= "300") { $rrd_options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal"; }
|
||||
|
||||
?>
|
||||
@@ -8,9 +8,10 @@ include("includes/graphs/common.inc.php");
|
||||
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
|
||||
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
|
||||
} elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D";
|
||||
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
|
||||
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
|
||||
elseif ($iter=="4") { $colour="73880A"; } elseif ($iter=="5") { $colour="D01F3C"; } elseif ($iter=="6") { $colour="36393D"; }
|
||||
elseif ($iter=="7") { $colour="FF0084"; unset($iter); }
|
||||
|
||||
$descr = substr(str_pad(short_hrDeviceDescr($proc['processor_descr']), 28),0,28);
|
||||
$descr = str_replace(":", "\:", $descr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user