Esempio n. 1
0
        $colour = 'CC0000';
    } elseif ($iter == '2') {
        $colour = '008C00';
    } elseif ($iter == '3') {
        $colour = '4096EE';
    } elseif ($iter == '4') {
        $colour = '73880A';
    } elseif ($iter == '5') {
        $colour = 'D01F3C';
    } elseif ($iter == '6') {
        $colour = '36393D';
    } elseif ($iter == '7') {
        $colour = 'FF0084';
        unset($iter);
    }
    $descr = rrdtool_escape(short_hrDeviceDescr($mempool['mempool_descr']), 22);
    $rrd_filename = rrd_name($device['hostname'], array('mempool', $mempool['mempool_type'], $mempool['mempool_index']));
    if (rrdtool_check_rrd_exists($rrd_filename)) {
        $rrd_options .= " DEF:mempoolfree{$i}={$rrd_filename}:free:AVERAGE ";
        $rrd_options .= " DEF:mempoolused{$i}={$rrd_filename}:used:AVERAGE ";
        $rrd_options .= " CDEF:mempooltotal{$i}=mempoolused{$i},mempoolused{$i},mempoolfree{$i},+,/,100,* ";
        $rrd_options .= " AREA:mempooltotal{$i}#" . $colour . '10';
        $rrd_optionsb .= " LINE1:mempooltotal{$i}#" . $colour . ":'" . $descr . "' ";
        $rrd_optionsb .= " GPRINT:mempooltotal{$i}:MIN:%3.0lf%%";
        $rrd_optionsb .= " GPRINT:mempooltotal{$i}:LAST:%3.0lf%%";
        $rrd_optionsb .= " GPRINT:mempooltotal{$i}:MAX:%3.0lf%%\\l ";
        $iter++;
        $i++;
    }
}
//end foreach
Esempio n. 2
0
<?php

$i = 0;
foreach ($procs as $proc) {
    $rrd_filename = rrd_name($device['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
    if (rrdtool_check_rrd_exists($rrd_filename)) {
        $descr = short_hrDeviceDescr($proc['processor_descr']);
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $descr;
        $rrd_list[$i]['ds'] = 'usage';
        $i++;
    }
}
$unit_text = 'Load %';
$units = '%';
$total_units = '%';
$colours = 'oranges';
$scale_min = '0';
$scale_max = '100';
$divider = $i;
$text_orig = 1;
$nototal = 1;
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
Esempio n. 3
0
<?php

$scale_min = '0';
$scale_max = '100';
$ds = 'usage';
// FIXME: As far as I can tell, $descr is never mentioned in includes/graphs/generic_simplex.inc.php -- PDG 2015-11-14
$descr = rrdtool_escape(short_hrDeviceDescr($proc['processor_descr']), 28);
$colour_line = 'cc0000';
$colour_area = 'FFBBBB';
$colour_minmax = 'c5c5c5';
$graph_max = 1;
$unit_text = 'Usage';
require 'includes/graphs/generic_simplex.inc.php';
Esempio n. 4
0
$scale_max = "100";
include "common.inc.php";
$iter = "1";
$sql = mysql_query("SELECT * FROM `processors` AS P, `devices` AS D where P.`processor_id` = '" . mres($_GET['id']) . "' AND P.device_id = D.device_id");
$rrd_options .= " COMMENT:'                                Cur    Max\\n'";
while ($proc = mysql_fetch_array($sql)) {
    if ($iter == "1") {
        $colour = "CC0000";
    } elseif ($iter == "2") {
        $colour = "008C00";
    } elseif ($iter == "3") {
        $colour = "4096EE";
    } elseif ($iter == "4") {
        $colour = "73880A";
    } elseif ($iter == "5") {
        $colour = "D01F3C";
    } elseif ($iter == "6") {
        $colour = "36393D";
    } elseif ($iter == "7") {
        $colour = "FF0084";
        unset($iter);
    }
    $descr = substr(str_pad(short_hrDeviceDescr($proc['processor_descr']), 28), 0, 28);
    $descr = str_replace(":", "\\:", $descr);
    $rrd = $config['rrd_dir'] . "/" . $proc['hostname'] . "/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
    $rrd_options .= " DEF:proc" . $proc['hrDeviceIndex'] . "={$rrd}:usage:AVERAGE ";
    $rrd_options .= " LINE1:proc" . $proc['hrDeviceIndex'] . "#" . $colour . ":'" . $descr . "' ";
    $rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":LAST:%3.0lf";
    $rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":MAX:%3.0lf\\\\l ";
    $iter++;
}
Esempio n. 5
0
<?php

include "includes/graphs/common.inc.php";
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`", array($class, $device['device_id'])) as $sensor) {
    $rrd_filename = get_sensor_rrd($device, $sensor);
    if (is_file($rrd_filename)) {
        $descr = short_hrDeviceDescr($sensor['sensor_descr']);
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $descr;
        $rrd_list[$i]['ds'] = "sensor";
        $i++;
    }
}
$unit_text = $unit_long;
$units = '%';
$total_units = '%';
$colours = 'mixed';
$nototal = 1;
include "includes/graphs/generic_multi_line.inc.php";
Esempio n. 6
0
while ($mempool = mysql_fetch_array($sql)) {
    if ($iter == "1") {
        $colour = "CC0000";
    } elseif ($iter == "2") {
        $colour = "008C00";
    } elseif ($iter == "3") {
        $colour = "4096EE";
    } elseif ($iter == "4") {
        $colour = "73880A";
    } elseif ($iter == "5") {
        $colour = "D01F3C";
    } elseif ($iter == "6") {
        $colour = "36393D";
    } elseif ($iter == "7") {
        $colour = "FF0084";
        unset($iter);
    }
    $descr = substr(str_pad(short_hrDeviceDescr($mempool['mempool_descr']), 24), 0, 24);
    $descr = str_replace(":", "\\:", $descr);
    $rrd = $config['rrd_dir'] . "/" . $mempool['hostname'] . "/" . safename("mempool-" . $mempool['mempool_type'] . "-" . $mempool['mempool_index'] . ".rrd");
    $rrd_options .= " DEF:mempoolfree={$rrd}:free:AVERAGE ";
    $rrd_options .= " DEF:mempoolused={$rrd}:used:AVERAGE ";
    $rrd_options .= " CDEF:mempooltotal=mempoolused,mempoolfree,+ ";
    $rrd_options .= " CDEF:mempoolperc=mempoolused,mempoolused,mempoolfree,+,/,100,* ";
    $rrd_options .= " LINE1:mempoolperc#" . $colour . ":'" . $descr . "' ";
    $rrd_options .= " GPRINT:mempoolused:LAST:%6.2lf%sB";
    #$rrd_options .= " GPRINT:mempooltotal:LAST:%6.2lf%sB";
    $rrd_options .= " GPRINT:mempoolperc:LAST:%3.0lf%%\\\\n";
    #$rrd_options .= " GPRINT:mempoolperc:MAX:%3.0lf";
    $iter++;
}
Esempio n. 7
0
<?php

$query = mysql_query("SELECT * FROM `hrDevice` where `device_id` = '" . mres($device_id) . "' AND hrDeviceType = 'hrDeviceProcessor'");
$i = 0;
while ($proc = mysql_fetch_array($query)) {
    $rrd_filename = $config['rrd_dir'] . "/{$hostname}/" . safename("hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd");
    if (is_file($rrd_filename)) {
        $descr = short_hrDeviceDescr($proc['hrDeviceDescr']);
        $descr = str_replace(":", "\\:", $descr);
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $descr;
        $rrd_list[$i]['rra'] = "usage";
        $i++;
    }
}
$unit_text = "Load %";
$units = '%';
$total_units = '%';
$colours = 'mixed';
$scale_min = "0";
$scale_max = "100";
$nototal = 1;
if ($rrd_list) {
    include "generic_multi_line.inc.php";
} else {
    include "common.inc.php";
    $rrd_filename = $config['rrd_dir'] . "/" . $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";