cosmetic updates

git-svn-id: http://www.observium.org/svn/observer/trunk@446 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-08-10 12:23:47 +00:00
parent 0e64ef858d
commit b76f28568a
7 changed files with 78 additions and 13 deletions

View File

@@ -32,11 +32,14 @@ $config['snmpset'] = "/usr/bin/snmpset";
# Set the general colours and other settings for rrdtool graphs
$config['rrdgraph_defaults'] = array("-c", "BACK#FFFFFF", "-c", "SHADEA#E5E5E5", "-c", "SHADEB#E5E5E5",
"-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
"-c", "MGRID#FFAAAA", "-c", "FRAME#5e5e5e", "-c", "ARROW#5e5e5e",
$config['rrdgraph_defaults'] = array("-c", "BACK#FFFFFF", "-c", "SHADEA#c5c5c5", "-c", "SHADEB#c5c5c5",
"-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#a5a5a5",
"-c", "MGRID#FF9999", "-c", "FRAME#5e5e5e", "-c", "ARROW#5e5e5e",
"-R", "normal");
$config['rrdgraph_def_text'] = " -c BACK#FFFFFF -c SHADEA#c5c5c5 -c SHADEB#c5c5c5 -c FONT#000000 -c CANVAS#FFFFFF -c GRID#a5a5a5 \
-c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal ";
$config['overlib_defaults'] = ",FGCOLOR,'#e5e5e5', BGCOLOR, '#e5e5e5'";

View File

@@ -43,7 +43,16 @@ function dhtml_response_list(&$items, $method) {
}
echo("<div style='width: auto; text-align: right; padding: 10px; display:block; background-color: #eeeeee;'>");
echo("<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
");
$plugins = collectd_list_plugins($device['hostname']);
foreach ($plugins as &$plugin) {
if(!$_GET['opta']) { $_GET['opta'] = $plugin; }
@@ -54,7 +63,17 @@ function dhtml_response_list(&$items, $method) {
$sep = ' | ';
}
unset ($sep);
echo("</div>");
echo("</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>");
$pinsts = collectd_list_pinsts($device['hostname'], $_GET['opta']);
foreach ($pinsts as &$instance) {
@@ -111,6 +130,4 @@ function dhtml_response_list(&$items, $method) {
}
?>

View File

@@ -29,8 +29,9 @@ $config['rrd_interval'] = 10;
// Average rows/rra (currently ignored)
$config['rrd_rows'] = 2400;
// Additional options to pass to rrdgraph
$config['rrd_opts'] = array('-E', "-c", "SHADEA#a5a5a5", "-c", "SHADEB#a5a5a5", "-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
"-c", "MGRID#FFAAAA", "-c", "FRAME#3e3e3e", "-c", "ARROW#5e5e5e", "-R", "normal");
$config['rrd_opts'] = $config['rrdgraph_defaults'];
#$config['rrd_opts'] = array('-E', "-c", "SHADEA#a5a5a5", "-c", "SHADEB#a5a5a5", "-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
# "-c", "MGRID#FFAAAA", "-c", "FRAME#3e3e3e", "-c", "ARROW#5e5e5e", "-R", "normal");
// Predefined set of colors for use by collectd_draw_rrd()
$config['rrd_colors'] = array(
'h_1'=>'F7B7B7', 'f_1'=>'FF0000', // Red

View File

@@ -8,7 +8,8 @@ include("graphing/unix.php");
function graph_multi_bits_trio ($interfaces, $graph, $from, $to, $width, $height, $title, $vertical, $inverse, $legend = '1') {
global $config, $installdir;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height";
$options = " --alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; }
$i = 1;
foreach(explode(",", $interfaces[0]) as $ifid) {
@@ -173,6 +174,7 @@ function graph_multi_bits_duo ($interfaces, $graph, $from, $to, $width, $height,
global $config, $installdir;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; }
$i = 1;
foreach(explode(",", $interfaces[1]) as $ifid) {
@@ -289,6 +291,7 @@ function graph_multi_bits ($interfaces, $graph, $from, $to, $width, $height, $ti
global $config, $installdir;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; }
$i = 1;
foreach(explode(",", $interfaces) as $ifid) {
@@ -338,6 +341,7 @@ function graph_multi_bits ($interfaces, $graph, $from, $to, $width, $height, $ti
function temp_graph ($temp, $graph, $from, $to, $width, $height, $title, $vertical) {
global $config, $installdir;
$options = " -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {
$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal ";
}
@@ -375,6 +379,7 @@ function graph_cpmCPU ($id, $graph, $from, $to, $width, $height, $title, $vertic
global $config, $installdir;
$options = "--start $from --end $to --width $width --height $height --vertical-label '$vertical' --alt-autoscale-max ";
$options .= " -l 0 -E -b 1024 --title '$title' ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph -u 100 -l 0 -r "; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
@@ -405,6 +410,7 @@ function graph_device_cpmCPU ($device, $graph, $from, $to, $width, $height, $tit
global $config, $installdir;
$options = "--start $from --end $to --width $width --height $height --vertical-label '$vertical' --alt-autoscale-max ";
$options .= " -l 0 -E -b 1024 --title '$title' ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph -u 100 -l 0 -r "; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
@@ -433,6 +439,7 @@ function graph_device_cempMemPool ($device, $graph, $from, $to, $width, $height,
global $config, $installdir;
$options = "--start $from --end $to --width $width --height $height --vertical-label '$vertical' --alt-autoscale-max ";
$options .= " -l 0 -E -b 1024 --title '$title' ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph -u 100 -l 0 -r "; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
@@ -471,6 +478,7 @@ function graph_cempMemPool ($id, $graph, $from, $to, $width, $height, $title, $v
global $config, $installdir;
$options = "--start $from --end $to --width $width --height $height --vertical-label '$vertical' --alt-autoscale-max ";
$options .= " -l 0 -E -b 1024 --title '$title' ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
@@ -510,6 +518,7 @@ function temp_graph_dev ($device, $graph, $from, $to, $width, $height, $title, $
global $config, $installdir;
$options = "--start $from --end $to --width $width --height $height --vertical-label '$vertical' --alt-autoscale-max ";
$options .= " -l 0 -E -b 1024 --title '$title' ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph -u 100 -l 0 -r "; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
@@ -562,7 +571,6 @@ function graph_mac_acc ($id, $graph, $from, $to, $width, $height) {
}
function graph_mac_acc_old ($id, $graph, $from, $to, $width, $height) {
global $config;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
@@ -570,12 +578,12 @@ function graph_mac_acc_old ($id, $graph, $from, $to, $width, $height) {
$acc = mysql_fetch_array($query);
$database = $config['rrd_dir'] . "/" . $acc['hostname'] . "/mac-accounting/" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd";
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; }
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
if($height < "99") { $options .= " --only-graph"; }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:inoctets=$database:IN:AVERAGE";
$options .= " DEF:outoctets=$database:OUT:AVERAGE";
$options .= " CDEF:octets=inoctets,outoctets,+";
@@ -615,6 +623,7 @@ function graph_mac_acc_interface ($interface, $graph, $from, $to, $width, $heigh
global $config, $installdir;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; }
$hostname = gethostbyid($device);
$query = mysql_query("SELECT * FROM `mac_accounting` AS M, `interfaces` AS I, `devices` AS D WHERE M.interface_id = '$interface' AND I.interface_id = M.interface_id AND I.device_id = D.device_id");
@@ -657,6 +666,7 @@ function graph_bits ($rrd, $graph, $from, $to, $width, $height, $title, $vertica
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
if($inverse) {
@@ -731,6 +741,7 @@ function pktsgraph ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:in=$database:INUCASTPKTS:AVERAGE";
@@ -756,6 +767,7 @@ function errorgraph ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:in=$database:INERRORS:AVERAGE";
@@ -781,6 +793,7 @@ function nucastgraph ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph"; unset ($legend); }
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:in=$database:INNUCASTPKTS:AVERAGE";
@@ -806,6 +819,7 @@ function graph_cbgp_prefixes ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:Accepted=$database:AcceptedPrefixes:AVERAGE";
#$options .= " DEF:Denied=$database:DeniedPrefixes:AVERAGE";
@@ -835,6 +849,7 @@ function bgpupdatesgraph ($rrd, $graph , $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:in=$database:bgpPeerInUpdates:AVERAGE";
$options .= " DEF:out=$database:bgpPeerOutUpdates:AVERAGE";
@@ -860,11 +875,11 @@ function graph_entity_sensor ($sensor, $graph , $from, $to, $width, $height, $ti
$sensor = mysql_fetch_array(mysql_query("SELECT * FROM entPhysical as E, devices as D WHERE entPhysical_id = '$sensor' and D.device_id = E.device_id"));
$database = $config['rrd_dir'] . "/" . $sensor['hostname'] . "/ces-" . $sensor['entPhysicalIndex'] . ".rrd";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($height < "99") { $options .= " --only-graph -u 100 -l 0 -r "; unset ($legend); }
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$type = str_pad($sensor['entSensorType'], 8);
$type = substr($type,0,8);
$options .= " DEF:avg=$database:value:AVERAGE";
$options .= " DEF:min=$database:value:MIN";
$options .= " DEF:max=$database:value:MAX";
@@ -889,6 +904,7 @@ function graph_cpu_generic_single ($rrd, $graph , $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:cpu=$database:cpu:AVERAGE";
$options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
@@ -905,6 +921,7 @@ function graph_adsl_rate ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrAtt=$database:adslAtucCurrAtt:AVERAGE";
$options .= " DEF:adslAturCurrAtt=$database:adslAturCurrAtt:AVERAGE";
@@ -926,6 +943,7 @@ function graph_adsl_snr ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrSnr=$database:adslAtucCurrSnr:AVERAGE";
$options .= " DEF:adslAturCurrSnr=$database:adslAturCurrSnr:AVERAGE";
@@ -947,6 +965,7 @@ function graph_adsl_atn ($rrd, $graph, $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:adslAtucCurrAtn=$database:adslAtucCurrAtn:AVERAGE";
$options .= " DEF:adslAturCurrAtn=$database:adslAturCurrAtn:AVERAGE";
@@ -968,6 +987,7 @@ function cpugraph ($rrd, $graph , $from, $to, $width, $height) {
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") {$options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:5s=$database:LOAD5S:AVERAGE";
$options .= " DEF:5m=$database:LOAD5M:AVERAGE";
@@ -984,6 +1004,7 @@ function uptimegraph ($rrd, $graph , $from, $to, $width, $height, $title, $verti
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:uptime=$database:uptime:AVERAGE";
$options .= " CDEF:cuptime=uptime,86400,/";
@@ -1002,6 +1023,7 @@ function memgraph ($rrd, $graph , $from, $to, $width, $height, $title, $vertical
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "-l 0 --alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:MEMTOTAL=$database:MEMTOTAL:AVERAGE";
$options .= " DEF:IOFREE=$database:IOFREE:AVERAGE";
@@ -1033,6 +1055,7 @@ function ip_graph ($rrd, $graph, $from, $to, $width, $height) {
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:ipForwDatagrams=$database:ipForwDatagrams:AVERAGE";
$options .= " DEF:ipInDelivers=$database:ipInDelivers:AVERAGE";
@@ -1080,6 +1103,7 @@ function icmp_graph ($rrd, $graph, $from, $to, $width, $height) {
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; } $options .= "DEF:icmpInMsgs=$database:icmpInMsgs:AVERAGE";
$options .= " DEF:icmpOutMsgs=$database:icmpOutMsgs:AVERAGE";
$options .= " DEF:icmpInErrors=$database:icmpInErrors:AVERAGE";
@@ -1131,6 +1155,7 @@ function tcp_graph ($rrd, $graph, $from, $to, $width, $height) {
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; } $options .= "DEF:icmpInMsgs=$database:icmpInMsgs:AVERAGE";
$options .= " DEF:tcpActiveOpens=$database:tcpActiveOpens:AVERAGE";
$options .= " DEF:tcpPassiveOpens=$database:tcpPassiveOpens:AVERAGE";
@@ -1178,6 +1203,7 @@ function udp_graph ($rrd, $graph, $from, $to, $width, $height) {
$imgfile = $config['install_dir'] . "/graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; } $options .= "DEF:icmpInMsgs=$database:icmpInMsgs:AVERAGE";
$options .= " DEF:udpInDatagrams=$database:udpInDatagrams:AVERAGE";
$options .= " DEF:udpOutDatagrams=$database:udpOutDatagrams:AVERAGE";

View File

@@ -5,6 +5,7 @@ function graph_fortigate_sessions ($rrd, $graph, $from, $to, $width, $height, $t
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:sessions=$database:sessions:AVERAGE";
$options .= " COMMENT:Sessions\ \ \ \ \ \ Current\ \ \ \ Average\ \ \ \ Maximum\\\\n";
@@ -23,6 +24,7 @@ function graph_fortigate_cpu ($rrd, $graph, $from, $to, $width, $height, $title,
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:cpu=$database:cpu:AVERAGE";
$options .= " COMMENT:Usage\ \ \ \ \ \ \ Current\ \ \ \ \ Average\ \ \ \ Maximum\\\\n";
@@ -40,6 +42,7 @@ function graph_fortigate_memory ($rrd, $graph, $from, $to, $width, $height, $tit
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:mem=$database:mem:AVERAGE";
$options .= " DEF:kcap=$database:memcapacity:AVERAGE";

View File

@@ -5,6 +5,7 @@ function graph_netscreen_sessions ($rrd, $graph, $from, $to, $width, $height, $t
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:alloc=$database:allocate:AVERAGE";
$options .= " DEF:max=$database:max:AVERAGE";
@@ -26,6 +27,7 @@ function graph_netscreen_cpu ($rrd, $graph, $from, $to, $width, $height, $title,
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:av=$database:average:AVERAGE";
$options .= " DEF:5m=$database:5min:AVERAGE";
@@ -48,6 +50,7 @@ function graph_netscreen_memory ($rrd, $graph, $from, $to, $width, $height, $tit
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "-l 0 -Y -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:alloc=$database:allocate:AVERAGE";
$options .= " DEF:left=$database:left:AVERAGE";

View File

@@ -6,6 +6,7 @@ function mailerrorgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$range = $to - $from;
@@ -65,6 +66,7 @@ function mailsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$range = $to - $from;
$points_per_sample = 3;
@@ -102,6 +104,7 @@ function memgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:atotalswap=$database:totalswap:AVERAGE";
$options .= " DEF:aavailswap=$database:availswap:AVERAGE";
@@ -168,6 +171,7 @@ function loadgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $vert
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:1min=$database:1min:AVERAGE";
$options .= " DEF:5min=$database:5min:AVERAGE";
@@ -201,6 +205,7 @@ function usersgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:users=$database:users:AVERAGE";
$options .= " COMMENT:Users\ \ \ \ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n";
@@ -220,6 +225,7 @@ function procsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $ver
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:procs=$database:procs:AVERAGE";
$options .= " COMMENT:Processes\ \ \ \ Cur\ \ \ \ \ Ave\ \ \ \ \ \ Min\ \ \ \ \ Max\\\\n";
@@ -242,6 +248,7 @@ function cpugraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $verti
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "-l 0 --alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:user=$database:user:AVERAGE";
$options .= " DEF:nice=$database:nice:AVERAGE";
@@ -279,6 +286,7 @@ function couriergraphUnix ($rrd, $graph, $from, $to, $width, $height, $title, $v
$imgfile = "graphs/" . "$graph";
$period = $to - $from;
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$points_per_sample = 3;
$range = $to - $from;
@@ -328,6 +336,7 @@ function apachehitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:hits=$database:hits:AVERAGE";
$options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ \ \ Average\ \ \ \ \ Maximum\\\\n";
@@ -344,6 +353,7 @@ function unixfsgraph ($id, $graph, $from, $to, $width, $height, $title, $vertica
global $config, $installdir;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024 -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
$iter = "1";
@@ -377,6 +387,7 @@ function unixfsgraph_dev ($device, $graph, $from, $to, $width, $height, $title,
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -b 1024 -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$hostname = gethostbyid($device);
$iter = "1";
@@ -409,6 +420,7 @@ function apachebitsgraphUnix ($rrd, $graph, $from, $to, $width, $height, $title,
$database = $config['rrd_dir'] . "/" . $rrd;
$imgfile = "graphs/" . "$graph";
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height -l 0";
$options .= $config['rrdgraph_def_text'];
if($width <= "300") { $options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; }
$options .= " DEF:bits=$database:bits:AVERAGE";
$options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ \ \ Current\ \ \ \ \ Average\ \ \ \ \ Maximum\\\\n";