Commit version 24.12.13800
This commit is contained in:
@ -5,13 +5,13 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
include($config['html_dir']."/includes/graphs/common.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/common.inc.php");
|
||||
|
||||
$scale_min = 0;
|
||||
$colours = "mixed";
|
||||
@ -19,32 +19,29 @@ $nototal = 1;
|
||||
$unit_text = "Count";
|
||||
$rrd_filename = get_rrd_path($device, "app-nsd-queries.rrd");
|
||||
|
||||
$i = 0;
|
||||
$array = array();
|
||||
$i = 0;
|
||||
$array = [];
|
||||
|
||||
$dns_rcode = array('FORMERR', 'NOERROR', 'NOTIMP', 'NXDOMAIN', 'REFUSED', 'SERVFAIL', 'YXDOMAIN');
|
||||
$dns_rcode = ['FORMERR', 'NOERROR', 'NOTIMP', 'NXDOMAIN', 'REFUSED', 'SERVFAIL', 'YXDOMAIN'];
|
||||
|
||||
$colours = $config['graph_colours']['mixed']; # needs moar colours!
|
||||
|
||||
foreach ($dns_rcode as $rcode)
|
||||
{
|
||||
$array["rcode$rcode"] = array('descr' => strtoupper($rcode), 'colour' => $colours[(safe_count($array) % safe_count($colours))]);
|
||||
foreach ($dns_rcode as $rcode) {
|
||||
$array["rcode$rcode"] = ['descr' => strtoupper($rcode), 'colour' => $colours[(safe_count($array) % safe_count($colours))]];
|
||||
}
|
||||
|
||||
if (rrd_is_file($rrd_filename))
|
||||
{
|
||||
foreach ($array as $ds => $data)
|
||||
{
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $data['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $data['colour'];
|
||||
$i++;
|
||||
}
|
||||
if (rrd_is_file($rrd_filename)) {
|
||||
foreach ($array as $ds => $data) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $data['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = $data['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo("file missing: $rrd_filename");
|
||||
echo("file missing: $rrd_filename");
|
||||
}
|
||||
|
||||
include($config['html_dir']."/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
include($config['html_dir'] . "/includes/graphs/generic_multi_simplex_separated.inc.php");
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user