Fix coding style part 2

This commit is contained in:
Job Snijders
2015-07-15 11:04:22 +02:00
parent ad9590df9b
commit d8693f05ae
733 changed files with 37338 additions and 33926 deletions
+9 -12
View File
@@ -10,23 +10,20 @@
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
*/
$scale_min = "0";
$scale_min = '0';
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/asa_conns.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/asa_conns.rrd';
$rrd_options .= " DEF:connections=$rrd_filename:connections:AVERAGE";
$rrd_options .= " DEF:connections_max=$rrd_filename:connections:MAX";
$rrd_options .= " DEF:connections_min=$rrd_filename:connections:MIN";
$rrd_options .= " AREA:connections_min";
$rrd_options .= ' AREA:connections_min';
$rrd_options .= " LINE1.5:connections#cc0000:'" . rrdtool_escape('Current connections')."'";
$rrd_options .= " GPRINT:connections_min:MIN:%4.0lf";
$rrd_options .= " GPRINT:connections:LAST:%4.0lf";
$rrd_options .= " GPRINT:connections_max:MAX:%4.0lf\\\\l";
?>
$rrd_options .= " LINE1.5:connections#cc0000:'".rrdtool_escape('Current connections')."'";
$rrd_options .= ' GPRINT:connections_min:MIN:%4.0lf';
$rrd_options .= ' GPRINT:connections:LAST:%4.0lf';
$rrd_options .= ' GPRINT:connections_max:MAX:%4.0lf\\\\l';
+3 -6
View File
@@ -1,10 +1,7 @@
<?php
if ($auth || device_permitted($device['device_id']))
{
$title = generate_device_link($device);
if ($auth || device_permitted($device['device_id'])) {
$title = generate_device_link($device);
$graph_title = $device['hostname'];
$auth = true;
$auth = true;
}
?>
+47 -58
View File
@@ -1,73 +1,62 @@
<?php
// Generate a list of ports and then call the multi_bits grapher to generate from the list
$ds_in = 'INOCTETS';
$ds_out = 'OUTOCTETS';
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($device['device_id'])) as $port)
{
$ignore = 0;
if (is_array($config['device_traffic_iftype']))
{
foreach ($config['device_traffic_iftype'] as $iftype)
{
if (preg_match($iftype ."i", $port['ifType']))
{
$ignore = 1;
}
foreach (dbFetchRows('SELECT * FROM `ports` WHERE `device_id` = ?', array($device['device_id'])) as $port) {
$ignore = 0;
if (is_array($config['device_traffic_iftype'])) {
foreach ($config['device_traffic_iftype'] as $iftype) {
if (preg_match($iftype.'i', $port['ifType'])) {
$ignore = 1;
}
}
}
}
if (is_array($config['device_traffic_descr']))
{
foreach ($config['device_traffic_descr'] as $ifdescr)
{
if (preg_match($ifdescr."i", $port['ifDescr']) || preg_match($ifdescr."i", $port['ifName']) || preg_match($ifdescr."i", $port['portName']))
{
$ignore = 1;
}
if (is_array($config['device_traffic_descr'])) {
foreach ($config['device_traffic_descr'] as $ifdescr) {
if (preg_match($ifdescr.'i', $port['ifDescr']) || preg_match($ifdescr.'i', $port['ifName']) || preg_match($ifdescr.'i', $port['portName'])) {
$ignore = 1;
}
}
}
}
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
if ($ignore != 1 && is_file($rrd_filename))
{
$port = ifLabel($port); // Fix Labels! ARGH. This needs to be in the bloody database!
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/port-'.safename($port['ifIndex'].'.rrd');
if ($ignore != 1 && is_file($rrd_filename)) {
$port = ifLabel($port);
// Fix Labels! ARGH. This needs to be in the bloody database!
$rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = shorten_interface_type($port['label']);
$rrd_list[$i]['descr_in'] = $port['label'];
$rrd_list[$i]['descr_out'] = $port['ifAlias'];
$rrd_list[$i]['ds_in'] = $ds_in;
$rrd_list[$i]['ds_out'] = $ds_out;
$i++;
}
$rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = shorten_interface_type($port['label']);
$rrd_list[$i]['descr_in'] = $port['label'];
$rrd_list[$i]['descr_out'] = $port['ifAlias'];
$rrd_list[$i]['ds_in'] = $ds_in;
$rrd_list[$i]['ds_out'] = $ds_out;
$i++;
}
unset($ignore);
}//end foreach
unset($ignore);
}
$units ='b';
$total_units ='B';
$colours_in ='greens';
$multiplier = "8";
$units = 'b';
$total_units = 'B';
$colours_in = 'greens';
$multiplier = '8';
$colours_out = 'blues';
#$nototal = 1;
// $nototal = 1;
$ds_in = 'INOCTETS';
$ds_out = 'OUTOCTETS';
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
$graph_title .= '::bits';
$graph_title .= "::bits";
$colour_line_in = '006600';
$colour_line_out = '000099';
$colour_area_in = '91B13C';
$colour_area_out = '8080BD';
$colour_line_in = "006600";
$colour_line_out = "000099";
$colour_area_in = "91B13C";
$colour_area_out = "8080BD";
require 'includes/graphs/generic_multi_seperated.inc.php';
include("includes/graphs/generic_multi_seperated.inc.php");
#include("includes/graphs/generic_multi_bits_separated.inc.php");
#include("includes/graphs/generic_multi_data_separated.inc.php");
?>
// include("includes/graphs/generic_multi_bits_separated.inc.php");
// include("includes/graphs/generic_multi_data_separated.inc.php");
+4 -6
View File
@@ -1,9 +1,7 @@
<?php
$class = "charge";
$unit = "%%";
$unit_long = "Percent";
$class = 'charge';
$unit = '%%';
$unit_long = 'Percent';
include("includes/graphs/device/sensor.inc.php");
?>
require 'includes/graphs/device/sensor.inc.php';
@@ -1,85 +1,82 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/cipsec_flow.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/cipsec_flow.rrd';
$i=0;
$i = 0;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InAuths";
$rrd_list[$i]['ds'] = "InAuths";
$rrd_list[$i]['descr'] = 'InAuths';
$rrd_list[$i]['ds'] = 'InAuths';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutAuths";
$rrd_list[$i]['ds'] = "OutAuths";
$ds_list[$i]['invert'] = "1";
$rrd_list[$i]['descr'] = 'OutAuths';
$rrd_list[$i]['ds'] = 'OutAuths';
$ds_list[$i]['invert'] = '1';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InDecrypts";
$rrd_list[$i]['ds'] = "InDencrypts";
$rrd_list[$i]['descr'] = 'InDecrypts';
$rrd_list[$i]['ds'] = 'InDencrypts';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutEncrypts";
$rrd_list[$i]['ds'] = "OutEncrypts";
$ds_list[$i]['invert'] = "1";
$rrd_list[$i]['descr'] = 'OutEncrypts';
$rrd_list[$i]['ds'] = 'OutEncrypts';
$ds_list[$i]['invert'] = '1';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InDrops";
$rrd_list[$i]['ds'] = "InDrops";
$rrd_list[$i]['descr'] = 'InDrops';
$rrd_list[$i]['ds'] = 'InDrops';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InReplayDrops";
$rrd_list[$i]['ds'] = "InReplayDrops";
$rrd_list[$i]['descr'] = 'InReplayDrops';
$rrd_list[$i]['ds'] = 'InReplayDrops';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutDrops";
$rrd_list[$i]['ds'] = "OutDrops";
$ds_list[$i]['invert'] = "1";
$rrd_list[$i]['descr'] = 'OutDrops';
$rrd_list[$i]['ds'] = 'OutDrops';
$ds_list[$i]['invert'] = '1';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InAuthFail";
$rrd_list[$i]['ds'] = "InAuthFails";
$rrd_list[$i]['descr'] = 'InAuthFail';
$rrd_list[$i]['ds'] = 'InAuthFails';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutAuthFail";
$rrd_list[$i]['ds'] = "OutAuthFails";
$ds_list[$i]['invert'] = "1";
$rrd_list[$i]['descr'] = 'OutAuthFail';
$rrd_list[$i]['ds'] = 'OutAuthFails';
$ds_list[$i]['invert'] = '1';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "InDecryptFails";
$rrd_list[$i]['ds'] = "InDecryptFails";
$rrd_list[$i]['descr'] = 'InDecryptFails';
$rrd_list[$i]['ds'] = 'InDecryptFails';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "OutEncryptFails";
$rrd_list[$i]['ds'] = "OutEncryptFails";
$ds_list[$i]['invert'] = "1";
$rrd_list[$i]['descr'] = 'OutEncryptFails';
$rrd_list[$i]['ds'] = 'OutEncryptFails';
$ds_list[$i]['invert'] = '1';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "ProtocolUseFails";
$rrd_list[$i]['ds'] = "ProtocolUseFails";
$rrd_list[$i]['descr'] = 'ProtocolUseFails';
$rrd_list[$i]['ds'] = 'ProtocolUseFails';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "NoSaFails";
$rrd_list[$i]['ds'] = "NoSaFails";
$rrd_list[$i]['descr'] = 'NoSaFails';
$rrd_list[$i]['ds'] = 'NoSaFails';
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = "SysCapFails";
$rrd_list[$i]['ds'] = "SysCapFails";
$rrd_list[$i]['descr'] = 'SysCapFails';
$rrd_list[$i]['ds'] = 'SysCapFails';
#$units='%';
#$total_units='%';
$colours='mixed';
$scale_min = "0";
#$scale_max = "100";
// $units='%';
// $total_units='%';
$colours = 'mixed';
$scale_min = '0';
// $scale_max = "100";
$nototal = 1;
include("includes/graphs/generic_multi_line.inc.php");
?>
require 'includes/graphs/generic_multi_line.inc.php';
+205 -147
View File
@@ -1,4 +1,5 @@
<?php // vim:fenc=utf-8:filetype=php:ts=4
<?php
/*
* Copyright (C) 2009 Bruno Prémont <bonbons AT linux-vserver.org>
*
@@ -16,27 +17,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require('includes/collectd/config.php');
require('includes/collectd/functions.php');
require('includes/collectd/definitions.php');
require 'includes/collectd/config.php';
require 'includes/collectd/functions.php';
require 'includes/collectd/definitions.php';
function makeTextBlock($text, $fontfile, $fontsize, $width) {
// TODO: handle explicit line-break!
$words = explode(' ', $text);
$lines = array($words[0]);
$currentLine = 0;
foreach ($words as $word) {
$lineSize = imagettfbbox($fontsize, 0, $fontfile, $lines[$currentLine] . ' ' . $word);
if ($lineSize[2] - $lineSize[0] < $width) {
$lines[$currentLine] .= ' ' . $word;
} else {
$currentLine++;
$lines[$currentLine] = $word;
// TODO: handle explicit line-break!
$words = explode(' ', $text);
$lines = array($words[0]);
$currentLine = 0;
foreach ($words as $word) {
$lineSize = imagettfbbox($fontsize, 0, $fontfile, $lines[$currentLine].' '.$word);
if (($lineSize[2] - $lineSize[0]) < $width) {
$lines[$currentLine] .= ' '.$word;
}
else {
$currentLine++;
$lines[$currentLine] = $word;
}
}
}
error_log(sprintf('Handles message "%s", %d words => %d/%d lines', $text, count($words), $currentLine, count($lines)));
return implode("\n", $lines);
}
error_log(sprintf('Handles message "%s", %d words => %d/%d lines', $text, count($words), $currentLine, count($lines)));
return implode("\n", $lines);
}//end makeTextBlock()
/**
* No RRD files found that could match request
@@ -46,124 +52,150 @@ function makeTextBlock($text, $fontfile, $fontsize, $width) {
* @msg Complete error message to display in place of graph content
*/
function error($code, $code_msg, $title, $msg) {
global $config;
global $config;
header(sprintf("HTTP/1.0 %d %s", $code, $code_msg));
header("Pragma: no-cache");
header("Expires: Mon, 01 Jan 2008 00:00:00 CET");
header("Content-Type: image/png");
$w = $config['rrd_width']+81;
$h = $config['rrd_height']+79;
header(sprintf('HTTP/1.0 %d %s', $code, $code_msg));
header('Pragma: no-cache');
header('Expires: Mon, 01 Jan 2008 00:00:00 CET');
header('Content-Type: image/png');
$w = ($config['rrd_width'] + 81);
$h = ($config['rrd_height'] + 79);
$png = imagecreate($w, $h);
$c_bkgnd = imagecolorallocate($png, 240, 240, 240);
$c_fgnd = imagecolorallocate($png, 255, 255, 255);
$c_blt = imagecolorallocate($png, 208, 208, 208);
$c_brb = imagecolorallocate($png, 160, 160, 160);
$c_grln = imagecolorallocate($png, 114, 114, 114);
$c_grarr = imagecolorallocate($png, 128, 32, 32);
$c_txt = imagecolorallocate($png, 0, 0, 0);
$c_etxt = imagecolorallocate($png, 64, 0, 0);
$png = imagecreate($w, $h);
$c_bkgnd = imagecolorallocate($png, 240, 240, 240);
$c_fgnd = imagecolorallocate($png, 255, 255, 255);
$c_blt = imagecolorallocate($png, 208, 208, 208);
$c_brb = imagecolorallocate($png, 160, 160, 160);
$c_grln = imagecolorallocate($png, 114, 114, 114);
$c_grarr = imagecolorallocate($png, 128, 32, 32);
$c_txt = imagecolorallocate($png, 0, 0, 0);
$c_etxt = imagecolorallocate($png, 64, 0, 0);
if (function_exists('imageantialias'))
imageantialias($png, true);
imagefilledrectangle($png, 0, 0, $w, $h, $c_bkgnd);
imagefilledrectangle($png, 51, 33, $w-31, $h-47, $c_fgnd);
imageline($png, 51, 30, 51, $h-43, $c_grln);
imageline($png, 48, $h-46, $w-28, $h-46, $c_grln);
imagefilledpolygon($png, array(49, 30, 51, 26, 53, 30), 3, $c_grarr);
imagefilledpolygon($png, array($w-28, $h-48, $w-24, $h-46, $w-28, $h-44), 3, $c_grarr);
imageline($png, 0, 0, $w, 0, $c_blt);
imageline($png, 0, 1, $w, 1, $c_blt);
imageline($png, 0, 0, 0, $h, $c_blt);
imageline($png, 1, 0, 1, $h, $c_blt);
imageline($png, $w-1, 0, $w-1, $h, $c_brb);
imageline($png, $w-2, 1, $w-2, $h, $c_brb);
imageline($png, 1, $h-2, $w, $h-2, $c_brb);
imageline($png, 0, $h-1, $w, $h-1, $c_brb);
if (function_exists('imageantialias')) {
imageantialias($png, true);
}
imagestring($png, 4, ceil(($w-strlen($title)*imagefontwidth(4)) / 2), 10, $title, $c_txt);
imagestring($png, 5, 60, 35, sprintf('%s [%d]', $code_msg, $code), $c_etxt);
if (function_exists('imagettfbbox') && is_file($config['error_font'])) {
// Detailled error message
$fmt_msg = makeTextBlock($msg, $errorfont, 10, $w-86);
$fmtbox = imagettfbbox(12, 0, $errorfont, $fmt_msg);
imagettftext($png, 10, 0, 55, 35+3+imagefontwidth(5)-$fmtbox[7]+$fmtbox[1], $c_txt, $errorfont, $fmt_msg);
} else {
imagestring($png, 4, 53, 35+6+imagefontwidth(5), $msg, $c_txt);
}
imagefilledrectangle($png, 0, 0, $w, $h, $c_bkgnd);
imagefilledrectangle($png, 51, 33, ($w - 31), ($h - 47), $c_fgnd);
imageline($png, 51, 30, 51, ($h - 43), $c_grln);
imageline($png, 48, ($h - 46), ($w - 28), ($h - 46), $c_grln);
imagefilledpolygon($png, array(49, 30, 51, 26, 53, 30), 3, $c_grarr);
imagefilledpolygon($png, array($w - 28, $h - 48, $w - 24, $h - 46, $w - 28, $h - 44), 3, $c_grarr);
imageline($png, 0, 0, $w, 0, $c_blt);
imageline($png, 0, 1, $w, 1, $c_blt);
imageline($png, 0, 0, 0, $h, $c_blt);
imageline($png, 1, 0, 1, $h, $c_blt);
imageline($png, ($w - 1), 0, ($w - 1), $h, $c_brb);
imageline($png, ($w - 2), 1, ($w - 2), $h, $c_brb);
imageline($png, 1, ($h - 2), $w, ($h - 2), $c_brb);
imageline($png, 0, ($h - 1), $w, ($h - 1), $c_brb);
imagestring($png, 4, ceil(($w - strlen($title) * imagefontwidth(4)) / 2), 10, $title, $c_txt);
imagestring($png, 5, 60, 35, sprintf('%s [%d]', $code_msg, $code), $c_etxt);
if (function_exists('imagettfbbox') && is_file($config['error_font'])) {
// Detailled error message
$fmt_msg = makeTextBlock($msg, $errorfont, 10, ($w - 86));
$fmtbox = imagettfbbox(12, 0, $errorfont, $fmt_msg);
imagettftext($png, 10, 0, 55, (35 + 3 + imagefontwidth(5) - $fmtbox[7] + $fmtbox[1]), $c_txt, $errorfont, $fmt_msg);
}
else {
imagestring($png, 4, 53, (35 + 6 + imagefontwidth(5)), $msg, $c_txt);
}
imagepng($png);
imagedestroy($png);
}//end error()
imagepng($png);
imagedestroy($png);
}
/**
* No RRD files found that could match request
*/
function error404($title, $msg) {
return error(404, "Not found", $title, $msg);
}
return error(404, 'Not found', $title, $msg);
}//end error404()
function error500($title, $msg) {
return error(500, "Not found", $title, $msg);
}
return error(500, 'Not found', $title, $msg);
}//end error500()
/**
* Incomplete / invalid request
*/
function error400($title, $msg) {
return error(400, "Bad request", $title, $msg);
}
return error(400, 'Bad request', $title, $msg);
}//end error400()
// Process input arguments
#$host = read_var('host', $_GET, null);
$host = $device['hostname'];
if (is_null($host))
return error400("?/?-?/?", "Missing host name");
else if (!is_string($host))
return error400("?/?-?/?", "Expecting exactly 1 host name");
else if (strlen($host) == 0)
return error400("?/?-?/?", "Host name may not be blank");
// $host = read_var('host', $_GET, null);
$host = $device['hostname'];
if (is_null($host)) {
return error400('?/?-?/?', 'Missing host name');
}
else if (!is_string($host)) {
return error400('?/?-?/?', 'Expecting exactly 1 host name');
}
else if (strlen($host) == 0) {
return error400('?/?-?/?', 'Host name may not be blank');
}
$plugin = read_var('c_plugin', $_GET, null);
if (is_null($plugin))
return error400($host.'/?-?/?', "Missing plugin name");
else if (!is_string($plugin))
return error400($host.'/?-?/?', "Plugin name must be a string");
else if (strlen($plugin) == 0)
return error400($host.'/?-?/?', "Plugin name may not be blank");
$plugin = read_var('c_plugin', $_GET, null);
if (is_null($plugin)) {
return error400($host.'/?-?/?', 'Missing plugin name');
}
else if (!is_string($plugin)) {
return error400($host.'/?-?/?', 'Plugin name must be a string');
}
else if (strlen($plugin) == 0) {
return error400($host.'/?-?/?', 'Plugin name may not be blank');
}
$pinst = read_var('c_plugin_instance', $_GET, '');
if (!is_string($pinst))
return error400($host.'/'.$plugin.'-?/?', "Plugin instance name must be a string");
$pinst = read_var('c_plugin_instance', $_GET, '');
if (!is_string($pinst)) {
return error400($host.'/'.$plugin.'-?/?', 'Plugin instance name must be a string');
}
$type = read_var('c_type', $_GET, '');
if (is_null($type))
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', "Missing type name");
else if (!is_string($type))
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', "Type name must be a string");
else if (strlen($type) == 0)
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', "Type name may not be blank");
$type = read_var('c_type', $_GET, '');
if (is_null($type)) {
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', 'Missing type name');
}
else if (!is_string($type)) {
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', 'Type name must be a string');
}
else if (strlen($type) == 0) {
return error400($host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/?', 'Type name may not be blank');
}
$tinst = read_var('c_type_instance', $_GET, '');
$tinst = read_var('c_type_instance', $_GET, '');
$graph_identifier = $host.'/'.$plugin.(strlen($pinst) ? '-'.$pinst : '').'/'.$type.(strlen($tinst) ? '-'.$tinst : '-*');
$timespan = read_var('timespan', $_GET, $config['timespan'][0]['name']);
$timespan = read_var('timespan', $_GET, $config['timespan'][0]['name']);
$timespan_ok = false;
foreach ($config['timespan'] as &$ts)
if ($ts['name'] == $timespan)
$timespan_ok = true;
if (!$timespan_ok)
return error400($graph_identifier, "Unknown timespan requested");
foreach ($config['timespan'] as &$ts) {
if ($ts['name'] == $timespan) {
$timespan_ok = true;
}
}
$logscale = (boolean)read_var('logarithmic', $_GET, false);
$tinylegend = (boolean)read_var('tinylegend', $_GET, false);
if (!$timespan_ok) {
return error400($graph_identifier, 'Unknown timespan requested');
}
$logscale = (boolean) read_var('logarithmic', $_GET, false);
$tinylegend = (boolean) read_var('tinylegend', $_GET, false);
// Check that at least 1 RRD exists for the specified request
$all_tinst = collectd_list_tinsts($host, $plugin, $pinst, $type);
if (count($all_tinst) == 0)
return error404($graph_identifier, "No rrd file found for graphing");
if (count($all_tinst) == 0) {
return error404($graph_identifier, 'No rrd file found for graphing');
}
// Now that we are read, do the bulk work
load_graph_definitions($logscale, $tinylegend);
@@ -171,57 +203,83 @@ load_graph_definitions($logscale, $tinylegend);
$pinst = strlen($pinst) == 0 ? null : $pinst;
$tinst = strlen($tinst) == 0 ? null : $tinst;
$opts = array();
$opts = array();
$opts['timespan'] = $timespan;
if ($logscale)
$opts['logarithmic'] = 1;
if ($tinylegend)
$opts['tinylegend'] = 1;
if ($logscale) {
$opts['logarithmic'] = 1;
}
if ($tinylegend) {
$opts['tinylegend'] = 1;
}
$rrd_cmd = false;
if (isset($MetaGraphDefs[$type])) {
$identifiers = array();
foreach ($all_tinst as &$atinst)
$identifiers[] = collectd_identifier($host, $plugin, is_null($pinst) ? '' : $pinst, $type, $atinst);
collectd_flush($identifiers);
$rrd_cmd = $MetaGraphDefs[$type]($host, $plugin, $pinst, $type, $all_tinst, $opts);
} else {
if (!in_array(is_null($tinst) ? '' : $tinst, $all_tinst))
return error404($host.'/'.$plugin.(!is_null($pinst) ? '-'.$pinst : '').'/'.$type.(!is_null($tinst) ? '-'.$tinst : ''), "No rrd file found for graphing");
collectd_flush(collectd_identifier($host, $plugin, is_null($pinst) ? '' : $pinst, $type, is_null($tinst) ? '' : $tinst));
if (isset($GraphDefs[$type]))
$rrd_cmd = collectd_draw_generic($timespan, $host, $plugin, $pinst, $type, $tinst);
else
$rrd_cmd = collectd_draw_rrd($host, $plugin, $pinst, $type, $tinst);
$identifiers = array();
foreach ($all_tinst as &$atinst) {
$identifiers[] = collectd_identifier($host, $plugin, is_null($pinst) ? '' : $pinst, $type, $atinst);
}
collectd_flush($identifiers);
$rrd_cmd = $MetaGraphDefs[$type]($host, $plugin, $pinst, $type, $all_tinst, $opts);
}
else {
if (!in_array(is_null($tinst) ? '' : $tinst, $all_tinst)) {
return error404($host.'/'.$plugin.(!is_null($pinst) ? '-'.$pinst : '').'/'.$type.(!is_null($tinst) ? '-'.$tinst : ''), 'No rrd file found for graphing');
}
collectd_flush(collectd_identifier($host, $plugin, is_null($pinst) ? '' : $pinst, $type, is_null($tinst) ? '' : $tinst));
if (isset($GraphDefs[$type])) {
$rrd_cmd = collectd_draw_generic($timespan, $host, $plugin, $pinst, $type, $tinst);
}
else {
$rrd_cmd = collectd_draw_rrd($host, $plugin, $pinst, $type, $tinst);
}
}
if(isset($rrd_cmd))
{
if ($_GET['from']) { $from = mres($_GET['from']); }
if ($_GET['to']) { $to = mres($_GET['to']); }
$rrd_cmd .= " -s " . $from . " -e " . $to;
if (isset($rrd_cmd)) {
if ($_GET['from']) {
$from = mres($_GET['from']);
}
if ($_GET['to']) {
$to = mres($_GET['to']);
}
$rrd_cmd .= ' -s '.$from.' -e '.$to;
}
if ($_GET['legend'] == "no") { $rrd_cmd .= " -g "; }
if ($_GET['legend'] == 'no') {
$rrd_cmd .= ' -g ';
}
if ($height < "99") { $rrd_cmd .= " --only-graph "; }
if ($width <= "300") { $rrd_cmd .= " --font LEGEND:7:" . $config['mono_font'] . " --font AXIS:6:" . $config['mono_font'] . " "; }
else { $rrd_cmd .= " --font LEGEND:8:" . $config['mono_font'] . " --font AXIS:7:" . $config['mono_font'] . " "; }
if ($height < '99') {
$rrd_cmd .= ' --only-graph ';
}
if ($width <= '300') {
$rrd_cmd .= ' --font LEGEND:7:'.$config['mono_font'].' --font AXIS:6:'.$config['mono_font'].' ';
}
else {
$rrd_cmd .= ' --font LEGEND:8:'.$config['mono_font'].' --font AXIS:7:'.$config['mono_font'].' ';
}
if (isset($_GET['debug'])) {
header('Content-Type: text/plain; charset=utf-8');
printf("Would have executed:\n%s\n", $rrd_cmd);
return 0;
} else if ($rrd_cmd) {
header('Content-Type: image/png');
header('Cache-Control: max-age=60');
$rt = 0;
passthru($rrd_cmd, $rt);
if ($rt != 0)
return error500($graph_identifier, "RRD failed to generate the graph: ".$rt);
return $rt;
} else {
return error500($graph_identifier, "Failed to tell RRD how to generate the graph");
header('Content-Type: text/plain; charset=utf-8');
printf("Would have executed:\n%s\n", $rrd_cmd);
return 0;
}
else if ($rrd_cmd) {
header('Content-Type: image/png');
header('Cache-Control: max-age=60');
$rt = 0;
passthru($rrd_cmd, $rt);
if ($rt != 0) {
return error500($graph_identifier, 'RRD failed to generate the graph: '.$rt);
}
?>
return $rt;
}
else {
return error500($graph_identifier, 'Failed to tell RRD how to generate the graph');
}
@@ -1,17 +1,15 @@
<?php
$units ='bps';
$total_units ='B';
$colours_in ='greens';
$multiplier = "8";
$units = 'bps';
$total_units = 'B';
$colours_in = 'greens';
$multiplier = '8';
$colours_out = 'blues';
$nototal = 1;
$ds_in = "read";
$ds_out = "written";
$ds_in = 'read';
$ds_out = 'written';
include("includes/graphs/device/diskio_common.inc.php");
require 'includes/graphs/device/diskio_common.inc.php';
include("includes/graphs/generic_multi_bits_separated.inc.php");
?>
require 'includes/graphs/generic_multi_bits_separated.inc.php';
@@ -1,19 +1,17 @@
<?php
$units = '';
$units = '';
$units_descr = 'Operations/sec';
$total_units = 'B';
$colours_in = 'greens';
$multiplier = "1";
$colours_in = 'greens';
$multiplier = '1';
$colours_out = 'blues';
$ds_in = "reads";
$ds_out = "writes";
$ds_in = 'reads';
$ds_out = 'writes';
$nototal = 1;
include("includes/graphs/device/diskio_common.inc.php");
require 'includes/graphs/device/diskio_common.inc.php';
include("includes/graphs/generic_multi_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_seperated.inc.php';
@@ -1,19 +1,17 @@
<?php
$scale_min = "0";
$scale_min = '0';
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/fdb_count.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/fdb_count.rrd';
$rrd_options .= " DEF:value=$rrd_filename:value:AVERAGE";
$rrd_options .= " DEF:value_min=$rrd_filename:value:MIN";
$rrd_options .= " DEF:value_max=$rrd_filename:value:MAX";
$rrd_options .= " COMMENT:'MACs Current Minimum Maximum Average\\n'";
$rrd_options .= " AREA:value#EEEEEE:value";
$rrd_options .= " LINE1.25:value#36393D:";
$rrd_options .= ' AREA:value#EEEEEE:value';
$rrd_options .= ' LINE1.25:value#36393D:';
$rrd_options .= " 'GPRINT:value:LAST:%6.2lf ' 'GPRINT:value_min:MIN:%6.2lf '";
$rrd_options .= " 'GPRINT:value_max:MAX:%6.2lf ' 'GPRINT:value:AVERAGE:%6.2lf\\n'";
?>
+4 -6
View File
@@ -1,9 +1,7 @@
<?php
$class = "load";
$unit = "%%";
$unit_long = "Load";
$class = 'load';
$unit = '%%';
$unit_long = 'Load';
include("includes/graphs/device/sensor.inc.php");
?>
require 'includes/graphs/device/sensor.inc.php';
+14 -13
View File
@@ -13,24 +13,25 @@
*/
$rrd_list = array();
$prefix = rrd_name($device['hostname'], array($subtype, ""), "");
foreach (glob($prefix."*.rrd") as $filename) {
$prefix = rrd_name($device['hostname'], array($subtype, ''), '');
foreach (glob($prefix.'*.rrd') as $filename) {
// find out what * expanded to
$globpart = str_replace($prefix, '', $filename); // take off the prefix
$instance = substr($globpart, 0, -4); // take off ".rrd"
$ds = array();
$mibparts = explode("-", $subtype);
$mibvar = end($mibparts);
$ds['ds'] = name_shorten($mibvar);
$ds['descr'] = "$mibvar-$instance";
$globpart = str_replace($prefix, '', $filename);
// take off the prefix
$instance = substr($globpart, 0, -4);
// take off ".rrd"
$ds = array();
$mibparts = explode('-', $subtype);
$mibvar = end($mibparts);
$ds['ds'] = name_shorten($mibvar);
$ds['descr'] = "$mibvar-$instance";
$ds['filename'] = $filename;
$rrd_list[] = $ds;
$rrd_list[] = $ds;
}
$colours = 'mixed';
$scale_min = "0";
$scale_min = '0';
$nototal = 0;
$simple_rrd = true;
include("includes/graphs/generic_multi_line.inc.php");
require 'includes/graphs/generic_multi_line.inc.php';
@@ -1,23 +1,21 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/netstats-ip_forward.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/netstats-ip_forward.rrd';
$stats = array('ipCidrRouteNumber' => array());
$i=0;
foreach ($stats as $stat => $array)
{
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace("ip", "", $stat);
$rrd_list[$i]['ds'] = $stat;
$i = 0;
foreach ($stats as $stat => $array) {
$i++;
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = str_replace('ip', '', $stat);
$rrd_list[$i]['ds'] = $stat;
}
$colours='mixed';
$colours = 'mixed';
$scale_min = "0";
$nototal = 1;
$simple_rrd = TRUE;
include("includes/graphs/generic_multi_line.inc.php");
$scale_min = '0';
$nototal = 1;
$simple_rrd = true;
require 'includes/graphs/generic_multi_line.inc.php';
@@ -12,16 +12,14 @@
* the source code distribution for details.
*/
$scale_min = "0";
$scale_min = '0';
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ping-perf.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/ping-perf.rrd';
$rrd_options .= " DEF:ping=".$rrd_filename.":ping:AVERAGE";
$rrd_options .= ' DEF:ping='.$rrd_filename.':ping:AVERAGE';
$rrd_options .= " 'COMMENT:Seconds Current Minimum Maximum Average\\n'";
$rrd_options .= " LINE1.25:ping#36393D:Ping";
$rrd_options .= " GPRINT:ping:LAST:%6.2lf GPRINT:ping:AVERAGE:%6.2lf";
$rrd_options .= ' LINE1.25:ping#36393D:Ping';
$rrd_options .= ' GPRINT:ping:LAST:%6.2lf GPRINT:ping:AVERAGE:%6.2lf';
$rrd_options .= " GPRINT:ping:MAX:%6.2lf 'GPRINT:ping:AVERAGE:%6.2lf\\n'";
?>
@@ -12,16 +12,14 @@
* the source code distribution for details.
*/
$scale_min = "0";
$scale_min = '0';
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/poller-perf.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/poller-perf.rrd';
$rrd_options .= " DEF:poller=".$rrd_filename.":poller:AVERAGE";
$rrd_options .= ' DEF:poller='.$rrd_filename.':poller:AVERAGE';
$rrd_options .= " 'COMMENT:Seconds Current Minimum Maximum Average\\n'";
$rrd_options .= " LINE1.25:poller#36393D:Poller";
$rrd_options .= " GPRINT:poller:LAST:%6.2lf GPRINT:poller:AVERAGE:%6.2lf";
$rrd_options .= ' LINE1.25:poller#36393D:Poller';
$rrd_options .= ' GPRINT:poller:LAST:%6.2lf GPRINT:poller:AVERAGE:%6.2lf';
$rrd_options .= " GPRINT:poller:MAX:%6.2lf 'GPRINT:poller:AVERAGE:%6.2lf\\n'";
?>
+53 -46
View File
@@ -1,51 +1,58 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
if ($_GET['width'] > "300") { $descr_len = "40"; } else { $descr_len = "22"; }
$rrd_options .= " -E ";
$iter = "1";
$rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)." Cur Min Max\\n'";
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`", array($class, $device['device_id'])) as $sensor)
{
// FIXME generic colour function
switch ($iter)
{
case "1":
$colour= "CC0000";
break;
case "2":
$colour= "008C00";
break;
case "3":
$colour= "4096EE";
break;
case "4":
$colour= "73880A";
break;
case "5":
$colour= "D01F3C";
break;
case "6":
$colour= "36393D";
break;
case "7":
default:
$colour= "FF0084";
unset($iter);
break;
}
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], $descr_len),0,$descr_len);
$rrd_file = get_sensor_rrd($device, $sensor);
$rrd_options .= " DEF:sensor" . $sensor['sensor_id'] . "=$rrd_file:sensor:AVERAGE ";
$rrd_options .= " LINE1:sensor" . $sensor['sensor_id'] . "#" . $colour . ":'" . str_replace(':','\:',str_replace('\*','*',$sensor['sensor_descr_fixed'])) . "'";
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":LAST:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":MIN:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":MAX:%4.1lf".$unit."\\\l ";
$iter++;
if ($_GET['width'] > '300') {
$descr_len = '40';
}
else {
$descr_len = '22';
}
?>
$rrd_options .= ' -E ';
$iter = '1';
$rrd_options .= " COMMENT:'".str_pad($unit_long, $descr_len)." Cur Min Max\\n'";
foreach (dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`', array($class, $device['device_id'])) as $sensor) {
// FIXME generic colour function
switch ($iter) {
case '1':
$colour = 'CC0000';
break;
case '2':
$colour = '008C00';
break;
case '3':
$colour = '4096EE';
break;
case '4':
$colour = '73880A';
break;
case '5':
$colour = 'D01F3C';
break;
case '6':
$colour = '36393D';
break;
case '7':
default:
$colour = 'FF0084';
unset($iter);
break;
}//end switch
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], $descr_len), 0, $descr_len);
$rrd_file = get_sensor_rrd($device, $sensor);
$rrd_options .= ' DEF:sensor'.$sensor['sensor_id']."=$rrd_file:sensor:AVERAGE ";
$rrd_options .= ' LINE1:sensor'.$sensor['sensor_id'].'#'.$colour.":'".str_replace(':', '\:', str_replace('\*', '*', $sensor['sensor_descr_fixed']))."'";
$rrd_options .= ' GPRINT:sensor'.$sensor['sensor_id'].':LAST:%4.1lf'.$unit.' ';
$rrd_options .= ' GPRINT:sensor'.$sensor['sensor_id'].':MIN:%4.1lf'.$unit.' ';
$rrd_options .= ' GPRINT:sensor'.$sensor['sensor_id'].':MAX:%4.1lf'.$unit.'\\\l ';
$iter++;
}//end foreach
@@ -1,15 +1,14 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-wireless.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-wireless.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'db Now Min Max\\n'";
$rrd_options .= " DEF:rfAverageCinr=".$rrdfilename.":rfAverageCinr:AVERAGE ";
$rrd_options .= ' DEF:rfAverageCinr='.$rrdfilename.':rfAverageCinr:AVERAGE ';
$rrd_options .= " LINE1:rfAverageCinr#CC0000:'CINR ' ";
$rrd_options .= " GPRINT:rfAverageCinr:LAST:%3.2lf ";
$rrd_options .= " GPRINT:rfAverageCinr:MIN:%3.2lf ";
$rrd_options .= " GPRINT:rfAverageCinr:MAX:%3.2lf\\\l ";
$rrd_options .= ' GPRINT:rfAverageCinr:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:rfAverageCinr:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:rfAverageCinr:MAX:%3.2lf\\\l ';
}
@@ -1,15 +1,14 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-wireless.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-wireless.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:rfAverageRssi=".$rrdfilename.":rfAverageRssi:AVERAGE ";
$rrd_options .= ' DEF:rfAverageRssi='.$rrdfilename.':rfAverageRssi:AVERAGE ';
$rrd_options .= " LINE1:rfAverageRssi#CC0000:'RSSI ' ";
$rrd_options .= " GPRINT:rfAverageRssi:LAST:%3.2lf ";
$rrd_options .= " GPRINT:rfAverageRssi:MIN:%3.2lf ";
$rrd_options .= " GPRINT:rfAverageRssi:MAX:%3.2lf\\\l ";
$rrd_options .= ' GPRINT:rfAverageRssi:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:rfAverageRssi:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:rfAverageRssi:MAX:%3.2lf\\\l ';
}
@@ -1,15 +1,14 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-wireless.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-wireless.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Hz Now Min Max\\n'";
$rrd_options .= " DEF:rfOperFreq=".$rrdfilename.":rfOperFreq:AVERAGE ";
$rrd_options .= ' DEF:rfOperFreq='.$rrdfilename.':rfOperFreq:AVERAGE ';
$rrd_options .= " LINE1:rfOperFreq#CC0000:'GHz ' ";
$rrd_options .= " GPRINT:rfOperFreq:LAST:%3.2lf ";
$rrd_options .= " GPRINT:rfOperFreq:MIN:%3.2lf ";
$rrd_options .= " GPRINT:rfOperFreq:MAX:%3.2lf\\\l ";
$rrd_options .= ' GPRINT:rfOperFreq:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:rfOperFreq:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:rfOperFreq:MAX:%3.2lf\\\l ';
}
@@ -1,22 +1,21 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-interface.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-interface.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'bps Now Ave Max \\n'";
$rrd_options .= " DEF:rfInOctets=".$rrdfilename.":rfInOctets:AVERAGE ";
$rrd_options .= " DEF:rfOutOctets=".$rrdfilename.":rfOutOctets:AVERAGE ";
//$rrd_options .= " CDEF:inoctets=rfInOctets,8,*";
//$rrd_options .= " CDEF:outoctets=rfOutOctets,8,*";
$rrd_options .= ' DEF:rfInOctets='.$rrdfilename.':rfInOctets:AVERAGE ';
$rrd_options .= ' DEF:rfOutOctets='.$rrdfilename.':rfOutOctets:AVERAGE ';
// $rrd_options .= " CDEF:inoctets=rfInOctets,8,*";
// $rrd_options .= " CDEF:outoctets=rfOutOctets,8,*";
$rrd_options .= " LINE1:rfInOctets#00FF00:'In ' ";
$rrd_options .= " GPRINT:rfInOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInOctets:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInOctets:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfOutOctets#CC0000:'Out ' ";
$rrd_options .= " GPRINT:rfOutOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutOctets:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfOutOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutOctets:MAX:%0.2lf%s\\\l ';
}
@@ -1,30 +1,29 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-interface.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-interface.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'bps Now Ave Max \\n'";
$rrd_options .= " DEF:rfInGoodOctets=".$rrdfilename.":rfInGoodOctets:AVERAGE ";
$rrd_options .= " DEF:rfInErroredOctets=".$rrdfilename.":rfInErroredOctets:AVERAGE ";
$rrd_options .= " DEF:rfInIdleOctets=".$rrdfilename.":rfInIdleOctets:AVERAGE ";
$rrd_options .= " DEF:rfOutIdleOctets=".$rrdfilename.":rfOutIdleOctets:AVERAGE ";
$rrd_options .= ' DEF:rfInGoodOctets='.$rrdfilename.':rfInGoodOctets:AVERAGE ';
$rrd_options .= ' DEF:rfInErroredOctets='.$rrdfilename.':rfInErroredOctets:AVERAGE ';
$rrd_options .= ' DEF:rfInIdleOctets='.$rrdfilename.':rfInIdleOctets:AVERAGE ';
$rrd_options .= ' DEF:rfOutIdleOctets='.$rrdfilename.':rfOutIdleOctets:AVERAGE ';
$rrd_options .= " LINE1:rfInGoodOctets#00FF00:'Good Octets ' ";
$rrd_options .= " GPRINT:rfInGoodOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInGoodOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInGoodOctets:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInGoodOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInGoodOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInGoodOctets:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfInErroredOctets#CC0000:'Errored Octets ' ";
$rrd_options .= " GPRINT:rfInErroredOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInErroredOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInErroredOctets:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInErroredOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInErroredOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInErroredOctets:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfInIdleOctets#0022FF:'In Idle Octets ' ";
$rrd_options .= " GPRINT:rfInIdleOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInIdleOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInIdleOctets:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInIdleOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInIdleOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInIdleOctets:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfOutIdleOctets#DD9CFB:'Out Idle Octets ' ";
$rrd_options .= " GPRINT:rfOutIdleOctets:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutIdleOctets:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutIdleOctets:MAX:%0.2lf%s\\\l ";
}
$rrd_options .= ' GPRINT:rfOutIdleOctets:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutIdleOctets:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutIdleOctets:MAX:%0.2lf%s\\\l ';
}//end if
@@ -1,25 +1,24 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-interface.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-interface.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'pps Now Ave Max \\n'";
$rrd_options .= " DEF:rfInGoodPkts=".$rrdfilename.":rfInGoodPkts:AVERAGE ";
$rrd_options .= " DEF:rfInErroredPkts=".$rrdfilename.":rfInErroredPkts:AVERAGE ";
$rrd_options .= " DEF:rfInLostPkts=".$rrdfilename.":rfInLostPkts:AVERAGE ";
$rrd_options .= ' DEF:rfInGoodPkts='.$rrdfilename.':rfInGoodPkts:AVERAGE ';
$rrd_options .= ' DEF:rfInErroredPkts='.$rrdfilename.':rfInErroredPkts:AVERAGE ';
$rrd_options .= ' DEF:rfInLostPkts='.$rrdfilename.':rfInLostPkts:AVERAGE ';
$rrd_options .= " LINE1:rfInGoodPkts#00FF00:'Good Pkts ' ";
$rrd_options .= " GPRINT:rfInGoodPkts:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInGoodPkts:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInGoodPkts:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInGoodPkts:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInGoodPkts:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInGoodPkts:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfInErroredPkts#CC0000:'Errored Pkts ' ";
$rrd_options .= " GPRINT:rfInErroredPkts:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInErroredPkts:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInErroredPkts:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInErroredPkts:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInErroredPkts:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInErroredPkts:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfInLostPkts#0022FF:'Lost Pkts ' ";
$rrd_options .= " GPRINT:rfInLostPkts:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInLostPkts:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInLostPkts:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInLostPkts:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInLostPkts:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInLostPkts:MAX:%0.2lf%s\\\l ';
}
@@ -1,20 +1,19 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/siklu-interface.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/siklu-interface.rrd';
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'pps Now Ave Max \\n'";
$rrd_options .= " DEF:rfInPkts=".$rrdfilename.":rfInPkts:AVERAGE ";
$rrd_options .= " DEF:rfOutPkts=".$rrdfilename.":rfOutPkts:AVERAGE ";
$rrd_options .= ' DEF:rfInPkts='.$rrdfilename.':rfInPkts:AVERAGE ';
$rrd_options .= ' DEF:rfOutPkts='.$rrdfilename.':rfOutPkts:AVERAGE ';
$rrd_options .= " LINE1:rfInPkts#00FF00:'In ' ";
$rrd_options .= " GPRINT:rfInPkts:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInPkts:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfInPkts:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfInPkts:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInPkts:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfInPkts:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:rfOutPkts#CC0000:'Out ' ";
$rrd_options .= " GPRINT:rfOutPkts:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutPkts:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rfOutPkts:MAX:%0.2lf%s\\\l ";
$rrd_options .= ' GPRINT:rfOutPkts:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutPkts:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rfOutPkts:MAX:%0.2lf%s\\\l ';
}
+23 -23
View File
@@ -1,36 +1,36 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
// FIXME - THIS IS BROKEN
$sla = dbFetchRow("SELECT * FROM `slas` WHERE `sla_id` = ?", array($vars['id']));
$sla = dbFetchRow('SELECT * FROM `slas` WHERE `sla_id` = ?', array($vars['id']));
$device = device_by_id_cache($sla['device_id']);
#if ($_GET['width'] >= "450") { $descr_len = "48"; } else { $descr_len = "21"; }
$descr_len = intval($_GET['width'] / 8) * 0.8;
// if ($_GET['width'] >= "450") { $descr_len = "48"; } else { $descr_len = "21"; }
$descr_len = (intval(($_GET['width'] / 8)) * 0.8);
$unit_long = 'milliseconds';
$unit = 'ms';
$unit = 'ms';
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)." Cur Min Max\\n'";
$rrd_options .= ' -l 0 -E ';
$rrd_options .= " COMMENT:'".str_pad($unit_long, $descr_len)." Cur Min Max\\n'";
$name = "";
if ($sla['tag'])
$name .= $sla['tag'];
if ($sla['owner'])
$name .= " (Owner: ". $sla['owner'] .")";
$name = '';
if ($sla['tag']) {
$name .= $sla['tag'];
}
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("sla-" . $sla['sla_nr'] . ".rrd");
if ($sla['owner']) {
$name .= ' (Owner: '.$sla['owner'].')';
}
$rrd_file = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('sla-'.$sla['sla_nr'].'.rrd');
$rrd_options .= " DEF:rtt=$rrd_file:rtt:AVERAGE ";
$rrd_options .= " VDEF:avg=rtt,AVERAGE ";
$rrd_options .= " LINE1:avg#CCCCFF:'".str_pad('Average',$descr_len-3)."':dashes";
$rrd_options .= " GPRINT:rtt:AVERAGE:%4.1lf".$unit."\\\l ";
$rrd_options .= " LINE1:rtt#CC0000:'" . rrdtool_escape($descr,$descr_len-3) . "'";
$rrd_options .= " GPRINT:rtt:LAST:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:rtt:MIN:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:rtt:MAX:%4.1lf".$unit."\\\l ";
?>
$rrd_options .= ' VDEF:avg=rtt,AVERAGE ';
$rrd_options .= " LINE1:avg#CCCCFF:'".str_pad('Average', ($descr_len - 3))."':dashes";
$rrd_options .= ' GPRINT:rtt:AVERAGE:%4.1lf'.$unit.'\\\l ';
$rrd_options .= " LINE1:rtt#CC0000:'".rrdtool_escape($descr, ($descr_len - 3))."'";
$rrd_options .= ' GPRINT:rtt:LAST:%4.1lf'.$unit.' ';
$rrd_options .= ' GPRINT:rtt:MIN:%4.1lf'.$unit.' ';
$rrd_options .= ' GPRINT:rtt:MAX:%4.1lf'.$unit.'\\\l ';
+4 -6
View File
@@ -1,9 +1,7 @@
<?php
$class = "state";
$unit = "";
$unit_long = "State";
$class = 'state';
$unit = '';
$unit_long = 'State';
include("includes/graphs/device/sensor.inc.php");
?>
require 'includes/graphs/device/sensor.inc.php';
+1 -2
View File
@@ -11,8 +11,7 @@ foreach (dbFetchRows('SELECT * FROM toner where device_id = ?', array($device['d
if ($colour['left'] == null) {
// FIXME generic colour function
switch ($iter)
{
switch ($iter) {
case '1':
$colour['left'] = '000000';
break;
@@ -1,24 +1,22 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= " DEF:rxCapacity=".$rrdfilename.":rxCapacity:AVERAGE ";
$rrd_options .= " DEF:txCapacity=".$rrdfilename.":txCapacity:AVERAGE ";
$rrd_options .= " CDEF:rxCapacityC=rxCapacity,1000000,/ ";
$rrd_options .= " CDEF:txCapacityC=txCapacity,1000000,/ ";
$rrd_options .= " LINE1:rxCapacityC#00FF00:'Rx Rate ' ";
$rrd_options .= " GPRINT:rxCapacityC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rxCapacityC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rxCapacityC:MAX:%0.2lf%s\\\l ";
$rrd_options .= " LINE1:txCapacityC#CC0000:'Tx Rate ' ";
$rrd_options .= " GPRINT:txCapacityC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:txCapacityC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:txCapacityC:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= ' DEF:rxCapacity='.$rrdfilename.':rxCapacity:AVERAGE ';
$rrd_options .= ' DEF:txCapacity='.$rrdfilename.':txCapacity:AVERAGE ';
$rrd_options .= ' CDEF:rxCapacityC=rxCapacity,1000000,/ ';
$rrd_options .= ' CDEF:txCapacityC=txCapacity,1000000,/ ';
$rrd_options .= " LINE1:rxCapacityC#00FF00:'Rx Rate ' ";
$rrd_options .= ' GPRINT:rxCapacityC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxCapacityC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxCapacityC:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:txCapacityC#CC0000:'Tx Rate ' ";
$rrd_options .= ' GPRINT:txCapacityC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:txCapacityC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:txCapacityC:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Metres Now Min Max\\n'";
$rrd_options .= " DEF:radioLinkDistM=".$rrdfilename.":radioLinkDistM:AVERAGE ";
$rrd_options .= " LINE1:radioLinkDistM#CC0000:'Distance ' ";
$rrd_options .= " GPRINT:radioLinkDistM:LAST:%3.2lf%s ";
$rrd_options .= " GPRINT:radioLinkDistM:MIN:%3.2lf%s ";
$rrd_options .= " GPRINT:radioLinkDistM:MAX:%3.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Metres Now Min Max\\n'";
$rrd_options .= ' DEF:radioLinkDistM='.$rrdfilename.':radioLinkDistM:AVERAGE ';
$rrd_options .= " LINE1:radioLinkDistM#CC0000:'Distance ' ";
$rrd_options .= ' GPRINT:radioLinkDistM:LAST:%3.2lf%s ';
$rrd_options .= ' GPRINT:radioLinkDistM:MIN:%3.2lf%s ';
$rrd_options .= ' GPRINT:radioLinkDistM:MAX:%3.2lf%s\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Octets Now Min Max\\n'";
$rrd_options .= " DEF:rxoctetsAll=".$rrdfilename.":rxoctetsAll:AVERAGE ";
$rrd_options .= " LINE1:rxoctetsAll#00CC00:'Rx Octets ' ";
$rrd_options .= " GPRINT:rxoctetsAll:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rxoctetsAll:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rxoctetsAll:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Octets Now Min Max\\n'";
$rrd_options .= ' DEF:rxoctetsAll='.$rrdfilename.':rxoctetsAll:AVERAGE ';
$rrd_options .= " LINE1:rxoctetsAll#00CC00:'Rx Octets ' ";
$rrd_options .= ' GPRINT:rxoctetsAll:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxoctetsAll:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxoctetsAll:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Octets Now Min Max\\n'";
$rrd_options .= " DEF:txoctetsAll=".$rrdfilename.":txoctetsAll:AVERAGE ";
$rrd_options .= " LINE1:txoctetsAll#CC0000:'Tx Octets ' ";
$rrd_options .= " GPRINT:txoctetsAll:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:txoctetsAll:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:txoctetsAll:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Octets Now Min Max\\n'";
$rrd_options .= ' DEF:txoctetsAll='.$rrdfilename.':txoctetsAll:AVERAGE ';
$rrd_options .= " LINE1:txoctetsAll#CC0000:'Tx Octets ' ";
$rrd_options .= ' GPRINT:txoctetsAll:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:txoctetsAll:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:txoctetsAll:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Packets Now Min Max\\n'";
$rrd_options .= " DEF:rxpktsAll=".$rrdfilename.":rxpktsAll:AVERAGE ";
$rrd_options .= " LINE1:rxpktsAll#CC0000:'Rx Packets ' ";
$rrd_options .= " GPRINT:rxpktsAll:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rxpktsAll:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rxpktsAll:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Packets Now Min Max\\n'";
$rrd_options .= ' DEF:rxpktsAll='.$rrdfilename.':rxpktsAll:AVERAGE ';
$rrd_options .= " LINE1:rxpktsAll#CC0000:'Rx Packets ' ";
$rrd_options .= ' GPRINT:rxpktsAll:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxpktsAll:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxpktsAll:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Packets Now Min Max\\n'";
$rrd_options .= " DEF:txpktsAll=".$rrdfilename.":txpktsAll:AVERAGE ";
$rrd_options .= " LINE1:txpktsAll#CC0000:'Tx Packets ' ";
$rrd_options .= " GPRINT:txpktsAll:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:txpktsAll:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:txpktsAll:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Packets Now Min Max\\n'";
$rrd_options .= ' DEF:txpktsAll='.$rrdfilename.':txpktsAll:AVERAGE ';
$rrd_options .= " LINE1:txpktsAll#CC0000:'Tx Packets ' ";
$rrd_options .= ' GPRINT:txpktsAll:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:txpktsAll:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:txpktsAll:MAX:%0.2lf%s\\\l ';
}
@@ -1,23 +1,20 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= " DEF:rxFrequency=".$rrdfilename.":rxFrequency:AVERAGE ";
$rrd_options .= " DEF:txFrequency=".$rrdfilename.":txFrequency:AVERAGE ";
$rrd_options .= " LINE1:rxFrequency#00FF00:'Rx Frequency ' ";
$rrd_options .= " GPRINT:rxFrequency:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:rxFrequency:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:rxFrequency:MAX:%0.2lf%s\\\l ";
$rrd_options .= " LINE1:txFrequency#CC0000:'Tx Frequency ' ";
$rrd_options .= " GPRINT:txFrequency:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:txFrequency:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:txFrequency:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= ' DEF:rxFrequency='.$rrdfilename.':rxFrequency:AVERAGE ';
$rrd_options .= ' DEF:txFrequency='.$rrdfilename.':txFrequency:AVERAGE ';
$rrd_options .= " LINE1:rxFrequency#00FF00:'Rx Frequency ' ";
$rrd_options .= ' GPRINT:rxFrequency:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxFrequency:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rxFrequency:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:txFrequency#CC0000:'Tx Frequency ' ";
$rrd_options .= ' GPRINT:txFrequency:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:txFrequency:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:txFrequency:MAX:%0.2lf%s\\\l ';
}
@@ -1,23 +1,20 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Celcius Now Min Max\\n'";
$rrd_options .= " DEF:radio0TempC=".$rrdfilename.":radio0TempC:AVERAGE ";
$rrd_options .= " DEF:radio1TempC=".$rrdfilename.":radio1TempC:AVERAGE ";
$rrd_options .= " LINE1:radio0TempC#00FF00:'Radio 0 ' ";
$rrd_options .= " GPRINT:radio0TempC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:radio0TempC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:radio0TempC:MAX:%0.2lf%s\\\l ";
$rrd_options .= " LINE1:radio1TempC#CC0000:'Radio 1 ' ";
$rrd_options .= " GPRINT:radio1TempC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:radio1TempC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:radio1TempC:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Celcius Now Min Max\\n'";
$rrd_options .= ' DEF:radio0TempC='.$rrdfilename.':radio0TempC:AVERAGE ';
$rrd_options .= ' DEF:radio1TempC='.$rrdfilename.':radio1TempC:AVERAGE ';
$rrd_options .= " LINE1:radio0TempC#00FF00:'Radio 0 ' ";
$rrd_options .= ' GPRINT:radio0TempC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:radio0TempC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:radio0TempC:MAX:%0.2lf%s\\\l ';
$rrd_options .= " LINE1:radio1TempC#CC0000:'Radio 1 ' ";
$rrd_options .= ' GPRINT:radio1TempC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:radio1TempC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:radio1TempC:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airfiber-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airfiber-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:txPower=".$rrdfilename.":txPower:AVERAGE ";
$rrd_options .= " LINE1:txPower#CC0000:'Tx Power ' ";
$rrd_options .= " GPRINT:txPower:LAST:%3.2lf ";
$rrd_options .= " GPRINT:txPower:MIN:%3.2lf ";
$rrd_options .= " GPRINT:txPower:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:txPower='.$rrdfilename.':txPower:AVERAGE ';
$rrd_options .= " LINE1:txPower#CC0000:'Tx Power ' ";
$rrd_options .= ' GPRINT:txPower:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:txPower:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:txPower:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= " DEF:AirMaxCapacity=".$rrdfilename.":AirMaxCapacity:AVERAGE ";
$rrd_options .= " LINE1:AirMaxCapacity#CC0000:'Percent ' ";
$rrd_options .= " GPRINT:AirMaxCapacity:LAST:%3.0lf ";
$rrd_options .= " GPRINT:AirMaxCapacity:MIN:%3.0lf ";
$rrd_options .= " GPRINT:AirMaxCapacity:MAX:%3.0lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= ' DEF:AirMaxCapacity='.$rrdfilename.':AirMaxCapacity:AVERAGE ';
$rrd_options .= " LINE1:AirMaxCapacity#CC0000:'Percent ' ";
$rrd_options .= ' GPRINT:AirMaxCapacity:LAST:%3.0lf ';
$rrd_options .= ' GPRINT:AirMaxCapacity:MIN:%3.0lf ';
$rrd_options .= ' GPRINT:AirMaxCapacity:MAX:%3.0lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= " DEF:AirMaxQuality=".$rrdfilename.":AirMaxQuality:AVERAGE ";
$rrd_options .= " LINE1:AirMaxQuality#CC0000:'Percent ' ";
$rrd_options .= " GPRINT:AirMaxQuality:LAST:%3.0lf ";
$rrd_options .= " GPRINT:AirMaxQuality:MIN:%3.0lf ";
$rrd_options .= " GPRINT:AirMaxQuality:MAX:%3.0lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= ' DEF:AirMaxQuality='.$rrdfilename.':AirMaxQuality:AVERAGE ';
$rrd_options .= " LINE1:AirMaxQuality#CC0000:'Percent ' ";
$rrd_options .= ' GPRINT:AirMaxQuality:LAST:%3.0lf ';
$rrd_options .= ' GPRINT:AirMaxQuality:MIN:%3.0lf ';
$rrd_options .= ' GPRINT:AirMaxQuality:MAX:%3.0lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Metres Now Min Max\\n'";
$rrd_options .= " DEF:RadioDistance=".$rrdfilename.":RadioDistance:AVERAGE ";
$rrd_options .= " LINE1:RadioDistance#CC0000:'Distance ' ";
$rrd_options .= " GPRINT:RadioDistance:LAST:%3.2lf%s ";
$rrd_options .= " GPRINT:RadioDistance:MIN:%3.2lf%s ";
$rrd_options .= " GPRINT:RadioDistance:MAX:%3.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Metres Now Min Max\\n'";
$rrd_options .= ' DEF:RadioDistance='.$rrdfilename.':RadioDistance:AVERAGE ';
$rrd_options .= " LINE1:RadioDistance#CC0000:'Distance ' ";
$rrd_options .= ' GPRINT:RadioDistance:LAST:%3.2lf%s ';
$rrd_options .= ' GPRINT:RadioDistance:MIN:%3.2lf%s ';
$rrd_options .= ' GPRINT:RadioDistance:MAX:%3.2lf%s\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= " DEF:RadioFreq=".$rrdfilename.":RadioFreq:AVERAGE ";
$rrd_options .= " LINE1:RadioFreq#CC0000:'Frequency ' ";
$rrd_options .= " GPRINT:RadioFreq:LAST:%3.2lf%s ";
$rrd_options .= " GPRINT:RadioFreq:MIN:%3.2lf%s ";
$rrd_options .= " GPRINT:RadioFreq:MAX:%3.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= ' DEF:RadioFreq='.$rrdfilename.':RadioFreq:AVERAGE ';
$rrd_options .= " LINE1:RadioFreq#CC0000:'Frequency ' ";
$rrd_options .= ' GPRINT:RadioFreq:LAST:%3.2lf%s ';
$rrd_options .= ' GPRINT:RadioFreq:MIN:%3.2lf%s ';
$rrd_options .= ' GPRINT:RadioFreq:MAX:%3.2lf%s\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:RadioRssi_0=".$rrdfilename.":RadioRssi_0:AVERAGE ";
$rrd_options .= " LINE1:RadioRssi_0#CC0000:'RSSI ' ";
$rrd_options .= " GPRINT:RadioRssi_0:LAST:%3.2lf ";
$rrd_options .= " GPRINT:RadioRssi_0:MIN:%3.2lf ";
$rrd_options .= " GPRINT:RadioRssi_0:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:RadioRssi_0='.$rrdfilename.':RadioRssi_0:AVERAGE ';
$rrd_options .= " LINE1:RadioRssi_0#CC0000:'RSSI ' ";
$rrd_options .= ' GPRINT:RadioRssi_0:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:RadioRssi_0:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:RadioRssi_0:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:RadioRssi_1=".$rrdfilename.":RadioRssi_1:AVERAGE ";
$rrd_options .= " LINE1:RadioRssi_1#00FF00:'RSSI ' ";
$rrd_options .= " GPRINT:RadioRssi_1:LAST:%3.2lf ";
$rrd_options .= " GPRINT:RadioRssi_1:MIN:%3.2lf ";
$rrd_options .= " GPRINT:RadioRssi_1:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:RadioRssi_1='.$rrdfilename.':RadioRssi_1:AVERAGE ';
$rrd_options .= " LINE1:RadioRssi_1#00FF00:'RSSI ' ";
$rrd_options .= ' GPRINT:RadioRssi_1:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:RadioRssi_1:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:RadioRssi_1:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:RadioTxPower=".$rrdfilename.":RadioTxPower:AVERAGE ";
$rrd_options .= " LINE1:RadioTxPower#CC0000:'Tx Power ' ";
$rrd_options .= " GPRINT:RadioTxPower:LAST:%3.2lf ";
$rrd_options .= " GPRINT:RadioTxPower:MIN:%3.2lf ";
$rrd_options .= " GPRINT:RadioTxPower:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:RadioTxPower='.$rrdfilename.':RadioTxPower:AVERAGE ';
$rrd_options .= " LINE1:RadioTxPower#CC0000:'Tx Power ' ";
$rrd_options .= ' GPRINT:RadioTxPower:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:RadioTxPower:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:RadioTxPower:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'Percent Now Min Max\\n'";
$rrd_options .= " DEF:WlStatCcq=".$rrdfilename.":WlStatCcq:AVERAGE ";
$rrd_options .= " LINE1:WlStatCcq#CC0000:'CCQ ' ";
$rrd_options .= " GPRINT:WlStatCcq:LAST:%3.2lf ";
$rrd_options .= " GPRINT:WlStatCcq:MIN:%3.2lf ";
$rrd_options .= " GPRINT:WlStatCcq:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'Percent Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatCcq='.$rrdfilename.':WlStatCcq:AVERAGE ';
$rrd_options .= " LINE1:WlStatCcq#CC0000:'CCQ ' ";
$rrd_options .= ' GPRINT:WlStatCcq:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatCcq:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatCcq:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:WlStatNoiseFloor=".$rrdfilename.":WlStatNoiseFloor:AVERAGE ";
$rrd_options .= " LINE1:WlStatNoiseFloor#CC0000:'Noise ' ";
$rrd_options .= " GPRINT:WlStatNoiseFloor:LAST:%3.2lf ";
$rrd_options .= " GPRINT:WlStatNoiseFloor:MIN:%3.2lf ";
$rrd_options .= " GPRINT:WlStatNoiseFloor:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatNoiseFloor='.$rrdfilename.':WlStatNoiseFloor:AVERAGE ';
$rrd_options .= " LINE1:WlStatNoiseFloor#CC0000:'Noise ' ";
$rrd_options .= ' GPRINT:WlStatNoiseFloor:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatNoiseFloor:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatNoiseFloor:MAX:%3.2lf\\\l ';
}
@@ -1,18 +1,15 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:WlStatRssi=".$rrdfilename.":WlStatRssi:AVERAGE ";
$rrd_options .= " LINE1:WlStatRssi#CC0000:'RSSI ' ";
$rrd_options .= " GPRINT:WlStatRssi:LAST:%3.2lf ";
$rrd_options .= " GPRINT:WlStatRssi:MIN:%3.2lf ";
$rrd_options .= " GPRINT:WlStatRssi:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatRssi='.$rrdfilename.':WlStatRssi:AVERAGE ';
$rrd_options .= " LINE1:WlStatRssi#CC0000:'RSSI ' ";
$rrd_options .= ' GPRINT:WlStatRssi:LAST:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatRssi:MIN:%3.2lf ';
$rrd_options .= ' GPRINT:WlStatRssi:MAX:%3.2lf\\\l ';
}
@@ -1,19 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= " DEF:WlStatRxRate=".$rrdfilename.":WlStatRxRate:AVERAGE ";
$rrd_options .= " CDEF:WlStatRxRateC=WlStatRxRate,1000,/ ";
$rrd_options .= " LINE1:WlStatRxRateC#00FF00:'Rx Rate ' ";
$rrd_options .= " GPRINT:WlStatRxRateC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:WlStatRxRateC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:WlStatRxRateC:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatRxRate='.$rrdfilename.':WlStatRxRate:AVERAGE ';
$rrd_options .= ' CDEF:WlStatRxRateC=WlStatRxRate,1000,/ ';
$rrd_options .= " LINE1:WlStatRxRateC#00FF00:'Rx Rate ' ";
$rrd_options .= ' GPRINT:WlStatRxRateC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:WlStatRxRateC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:WlStatRxRateC:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:WlStatSignal=".$rrdfilename.":WlStatSignal:AVERAGE ";
$rrd_options .= " LINE1:WlStatSignal#CC0000:'Signal ' ";
$rrd_options .= " GPRINT:WlStatSignal:LAST:%3.2lf ";
$rrd_options .= " GPRINT:WlStatSignal:MIN:%3.2lf ";
$rrd_options .= " GPRINT:WlStatSignal:MAX:%3.2lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dbm Now Min Max\\n'";
$rrd_options .= " DEF:WlStatSignal=".$rrdfilename.":WlStatSignal:AVERAGE ";
$rrd_options .= " LINE1:WlStatSignal#CC0000:'Signal ' ";
$rrd_options .= " GPRINT:WlStatSignal:LAST:%3.2lf ";
$rrd_options .= " GPRINT:WlStatSignal:MIN:%3.2lf ";
$rrd_options .= " GPRINT:WlStatSignal:MAX:%3.2lf\\\l ";
}
@@ -1,18 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_options .= " -l 0 -E ";
$rrd_options .= ' -l 0 -E ';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= " DEF:WlStatStaCount=".$rrdfilename.":WlStatStaCount:AVERAGE ";
$rrd_options .= " LINE1:WlStatStaCount#CC0000:'Stations ' ";
$rrd_options .= " GPRINT:WlStatStaCount:LAST:%3.0lf ";
$rrd_options .= " GPRINT:WlStatStaCount:MIN:%3.0lf ";
$rrd_options .= " GPRINT:WlStatStaCount:MAX:%3.0lf\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:' Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatStaCount='.$rrdfilename.':WlStatStaCount:AVERAGE ';
$rrd_options .= " LINE1:WlStatStaCount#CC0000:'Stations ' ";
$rrd_options .= ' GPRINT:WlStatStaCount:LAST:%3.0lf ';
$rrd_options .= ' GPRINT:WlStatStaCount:MIN:%3.0lf ';
$rrd_options .= ' GPRINT:WlStatStaCount:MAX:%3.0lf\\\l ';
}
@@ -1,19 +1,16 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
//$rrd_options .= " -l 0 -E ";
// $rrd_options .= " -l 0 -E ";
$rrdfilename = $config['rrd_dir'].'/'.$device['hostname'].'/ubnt-airmax-mib.rrd';
$rrdfilename = $config['rrd_dir'] . "/".$device['hostname']."/ubnt-airmax-mib.rrd";
if (file_exists($rrdfilename))
{
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= " DEF:WlStatTxRate=".$rrdfilename.":WlStatTxRate:AVERAGE ";
$rrd_options .= " CDEF:WlStatTxRateC=WlStatTxRate,1000,/ ";
$rrd_options .= " LINE1:WlStatTxRateC#CC0000:'Tx Rate ' ";
$rrd_options .= " GPRINT:WlStatTxRateC:LAST:%0.2lf%s ";
$rrd_options .= " GPRINT:WlStatTxRateC:MIN:%0.2lf%s ";
$rrd_options .= " GPRINT:WlStatTxRateC:MAX:%0.2lf%s\\\l ";
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'mbps Now Min Max\\n'";
$rrd_options .= ' DEF:WlStatTxRate='.$rrdfilename.':WlStatTxRate:AVERAGE ';
$rrd_options .= ' CDEF:WlStatTxRateC=WlStatTxRate,1000,/ ';
$rrd_options .= " LINE1:WlStatTxRateC#CC0000:'Tx Rate ' ";
$rrd_options .= ' GPRINT:WlStatTxRateC:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:WlStatTxRateC:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:WlStatTxRateC:MAX:%0.2lf%s\\\l ';
}
@@ -1,18 +1,16 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawContexts.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/ucd_ssRawContexts.rrd';
$ds = "value";
$ds = 'value';
$colour_area = "9999cc";
$colour_line = "0000cc";
$colour_area = '9999cc';
$colour_line = '0000cc';
$colour_area_max = "9999cc";
$colour_area_max = '9999cc';
$scale_min = 1;
$unit_text = "Switches/s";
$unit_text = 'Switches/s';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';
+11 -13
View File
@@ -1,33 +1,31 @@
<?php
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . "ucd_cpu.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.'ucd_cpu.rrd';
$rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE";
$rrd_options .= " DEF:nice=$rrd_filename:nice:AVERAGE";
$rrd_options .= " DEF:system=$rrd_filename:system:AVERAGE";
$rrd_options .= " DEF:idle=$rrd_filename:idle:AVERAGE";
$rrd_options .= " CDEF:total=user,nice,system,idle,+,+,+";
$rrd_options .= " CDEF:user_perc=user,total,/,100,*";
$rrd_options .= " CDEF:nice_perc=nice,total,/,100,*";
$rrd_options .= " CDEF:system_perc=system,total,/,100,*";
$rrd_options .= " CDEF:idle_perc=idle,total,/,100,*";
$rrd_options .= ' CDEF:total=user,nice,system,idle,+,+,+';
$rrd_options .= ' CDEF:user_perc=user,total,/,100,*';
$rrd_options .= ' CDEF:nice_perc=nice,total,/,100,*';
$rrd_options .= ' CDEF:system_perc=system,total,/,100,*';
$rrd_options .= ' CDEF:idle_perc=idle,total,/,100,*';
$rrd_options .= " COMMENT:'Usage Current Average Maximum\\n'";
$rrd_options .= " AREA:user_perc#c02020:user";
$rrd_options .= ' AREA:user_perc#c02020:user';
$rrd_options .= " GPRINT:user_perc:LAST:' %5.2lf%%'";
$rrd_options .= " GPRINT:user_perc:AVERAGE:' %5.2lf%%'";
$rrd_options .= " GPRINT:user_perc:MAX:' %5.2lf%%\\n'";
$rrd_options .= " AREA:nice_perc#008f00:nice:STACK";
$rrd_options .= ' AREA:nice_perc#008f00:nice:STACK';
$rrd_options .= " GPRINT:nice_perc:LAST:' %5.2lf%%'";
$rrd_options .= " GPRINT:nice_perc:AVERAGE:' %5.2lf%%'";
$rrd_options .= " GPRINT:nice_perc:MAX:' %5.2lf%%\\n'";
$rrd_options .= " AREA:system_perc#ea8f00:system:STACK";
$rrd_options .= ' AREA:system_perc#ea8f00:system:STACK';
$rrd_options .= " GPRINT:system_perc:LAST:' %5.2lf%%'";
$rrd_options .= " GPRINT:system_perc:AVERAGE:' %5.2lf%%'";
$rrd_options .= " GPRINT:system_perc:MAX:' %5.2lf%%\\n'";
$rrd_options .= " AREA:idle_perc#f8f8f3:idle:STACK";
$rrd_options .= ' AREA:idle_perc#f8f8f3:idle:STACK';
$rrd_options .= " GPRINT:idle_perc:LAST:' %5.2lf%%'";
$rrd_options .= " GPRINT:idle_perc:AVERAGE:' %5.2lf%%'";
$rrd_options .= " GPRINT:idle_perc:MAX:' %5.2lf%%\\n'";
?>
@@ -1,19 +1,17 @@
<?php
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/ucd_ssRawInterrupts.rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/ucd_ssRawInterrupts.rrd';
$ds = "value";
$ds = 'value';
$colour_area = "EEBBBB";
$colour_line = "CC0000";
$colour_area = 'EEBBBB';
$colour_line = 'CC0000';
$colour_area_max = "cc9999";
$colour_area_max = 'cc9999';
#$graph_max = 1;
// $graph_max = 1;
$scale_min = 0;
$unit_text = "Interrupts/s";
$unit_text = 'Interrupts/s';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';