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
@@ -2,27 +2,24 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$apache_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
$apache_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
if (is_file($apache_rrd))
{
$rrd_filename = $apache_rrd;
if (is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$ds = "kbyte";
$ds = 'kbyte';
$colour_area = "CDEB8B";
$colour_line = "006600";
$colour_area = 'CDEB8B';
$colour_line = '006600';
$colour_area_max = "FFEE99";
$colour_area_max = 'FFEE99';
$graph_max = 1;
$graph_max = 1;
$multiplier = 8;
$unit_text = "Kbps";
$unit_text = 'Kbps';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';
@@ -2,26 +2,23 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$apache_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
$apache_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
if (is_file($apache_rrd))
{
$rrd_filename = $apache_rrd;
if (is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$ds = "cpu";
$ds = 'cpu';
$colour_area = "F0E68C";
$colour_line = "FF4500";
$colour_area = 'F0E68C';
$colour_line = 'FF4500';
$colour_area_max = "FFEE99";
$colour_area_max = 'FFEE99';
$graph_max = 1;
$unit_text = "% Used";
$unit_text = '% Used';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';
@@ -2,26 +2,23 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$apache_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
$apache_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
if (is_file($apache_rrd))
{
$rrd_filename = $apache_rrd;
if (is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$ds = "access";
$ds = 'access';
$colour_area = "B0C4DE";
$colour_line = "191970";
$colour_area = 'B0C4DE';
$colour_line = '191970';
$colour_area_max = "FFEE99";
$colour_area_max = 'FFEE99';
$graph_max = 1;
$unit_text = "Hits/sec";
$unit_text = 'Hits/sec';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';
@@ -2,39 +2,69 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-apache-".$app['app_id'].".rrd";
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-apache-'.$app['app_id'].'.rrd';
$array = array('sb_reading' => array('descr' => 'Reading', 'colour' => '750F7DFF'),
'sb_writing' => array('descr' => 'Writing', 'colour' => '00FF00FF'),
'sb_wait' => array('descr' => 'Waiting', 'colour' => '4444FFFF'),
'sb_start' => array('descr' => 'Starting', 'colour' => '157419FF'),
'sb_keepalive' => array('descr' => 'Keepalive', 'colour' => 'FF0000FF'),
'sb_dns' => array('descr' => 'DNS', 'colour' => '6DC8FEFF'),
'sb_closing' => array('descr' => 'Closing', 'colour' => 'FFAB00FF'),
'sb_logging' => array('descr' => 'Logging', 'colour' => 'FFFF00FF'),
'sb_graceful' => array('descr' => 'Graceful', 'colour' => 'FF5576FF'),
'sb_idle' => array('descr' => 'Idle', 'colour' => 'FF4105FF'),
$array = array(
'sb_reading' => array(
'descr' => 'Reading',
'colour' => '750F7DFF',
),
'sb_writing' => array(
'descr' => 'Writing',
'colour' => '00FF00FF',
),
'sb_wait' => array(
'descr' => 'Waiting',
'colour' => '4444FFFF',
),
'sb_start' => array(
'descr' => 'Starting',
'colour' => '157419FF',
),
'sb_keepalive' => array(
'descr' => 'Keepalive',
'colour' => 'FF0000FF',
),
'sb_dns' => array(
'descr' => 'DNS',
'colour' => '6DC8FEFF',
),
'sb_closing' => array(
'descr' => 'Closing',
'colour' => 'FFAB00FF',
),
'sb_logging' => array(
'descr' => 'Logging',
'colour' => 'FFFF00FF',
),
'sb_graceful' => array(
'descr' => 'Graceful',
'colour' => 'FF5576FF',
),
'sb_idle' => array(
'descr' => 'Idle',
'colour' => 'FF4105FF',
),
);
$i = 0;
if (is_file($rrd_filename))
{
foreach ($array as $ds => $vars)
{
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else { echo("file missing: $file"); }
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
}
else {
echo "file missing: $file";
}
$colours = "mixed";
$colours = 'mixed';
$nototal = 1;
$unit_text = "Workers";
$unit_text = 'Workers';
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
@@ -1,19 +1,21 @@
<?php
/* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
/*
* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
/*
* Bind9 Query Graph
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
@@ -22,29 +24,40 @@
* @subpackage Graphs
*/
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = "Query/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-bind-".$app['app_id'].".rrd";
$array = array( 'any', 'a', 'aaaa', 'cname', 'mx', 'ns', 'ptr', 'soa', 'srv', 'spf' );
$colours = "merged";
$unit_text = 'Query/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-bind-'.$app['app_id'].'.rrd';
$array = array(
'any',
'a',
'aaaa',
'cname',
'mx',
'ns',
'ptr',
'soa',
'srv',
'spf',
);
$colours = 'merged';
$rrd_list = array();
$config['graph_colours']['merged'] = array_merge($config['graph_colours']['greens'], $config['graph_colours']['blues']);
if( is_file($rrd_filename) ) {
foreach( $array as $ds ) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else {
echo "file missing: $file";
if (is_file($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
@@ -2,21 +2,18 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$drbd_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-drbd-".$app['app_instance'].".rrd";
$drbd_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-drbd-'.$app['app_instance'].'.rrd';
if (is_file($drbd_rrd))
{
$rrd_filename = $drbd_rrd;
if (is_file($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
$ds_in = "dr";
$ds_out = "dw";
$ds_in = 'dr';
$ds_out = 'dw';
$multiplier = "8";
$format = "bytes";
$multiplier = '8';
$format = 'bytes';
include("includes/graphs/generic_data.inc.php");
?>
require 'includes/graphs/generic_data.inc.php';
@@ -2,20 +2,17 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$drbd_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-drbd-".$app['app_instance'].".rrd";
$drbd_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-drbd-'.$app['app_instance'].'.rrd';
if (is_file($drbd_rrd))
{
$rrd_filename = $drbd_rrd;
if (is_file($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
$ds_in = "nr";
$ds_out = "ns";
$ds_in = 'nr';
$ds_out = 'ns';
$multiplier = "8";
$multiplier = '8';
include("includes/graphs/generic_data.inc.php");
?>
require 'includes/graphs/generic_data.inc.php';
@@ -2,27 +2,24 @@
$scale_min = 0;
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$drbd_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-drbd-".$app['app_instance'].".rrd";
$drbd_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/app-drbd-'.$app['app_instance'].'.rrd';
if (is_file($drbd_rrd))
{
$rrd_filename = $drbd_rrd;
if (is_file($drbd_rrd)) {
$rrd_filename = $drbd_rrd;
}
$ds = "oos";
$ds = 'oos';
$colour_area = "CDEB8B";
$colour_line = "006600";
$colour_area = 'CDEB8B';
$colour_line = '006600';
$colour_area_max = "FFEE99";
$colour_area_max = 'FFEE99';
$graph_max = 1;
$graph_max = 1;
$multiplier = 8;
$unit_text = "Bytes";
$unit_text = 'Bytes';
include("includes/graphs/generic_simplex.inc.php");
?>
require 'includes/graphs/generic_simplex.inc.php';
@@ -1,13 +1,11 @@
<?php
include("memcached.inc.php");
include("includes/graphs/common.inc.php");
require 'memcached.inc.php';
require 'includes/graphs/common.inc.php';
$multiplier = 8;
$ds_in = "bytes_read";
$ds_out = "bytes_written";
$ds_in = 'bytes_read';
$ds_out = 'bytes_written';
include("includes/graphs/generic_data.inc.php");
?>
require 'includes/graphs/generic_data.inc.php';
@@ -5,43 +5,43 @@ require 'includes/graphs/common.inc.php';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-mysql-'.$app['app_id'].'.rrd';
$array = array(
'CDe' => array(
'descr' => 'Delete',
'colour' => '22FF22',
),
'CIt' => array(
'descr' => 'Insert',
'colour' => '0022FF',
),
'CISt' => array(
'descr' => 'Insert Select',
'colour' => 'FF0000',
),
'CLd' => array(
'descr' => 'Load Data',
'colour' => '00AAAA',
),
'CRe' => array(
'descr' => 'Replace',
'colour' => 'FF00FF',
),
'CRSt' => array(
'descr' => 'Replace Select',
'colour' => 'FFA500',
),
'CSt' => array(
'descr' => 'Select',
'colour' => 'CC0000',
),
'CUe' => array(
'descr' => 'Update',
'colour' => '0000CC',
),
'CUMi' => array(
'descr' => 'Update Multiple',
'colour' => '0080C0',
),
);
'CDe' => array(
'descr' => 'Delete',
'colour' => '22FF22',
),
'CIt' => array(
'descr' => 'Insert',
'colour' => '0022FF',
),
'CISt' => array(
'descr' => 'Insert Select',
'colour' => 'FF0000',
),
'CLd' => array(
'descr' => 'Load Data',
'colour' => '00AAAA',
),
'CRe' => array(
'descr' => 'Replace',
'colour' => 'FF00FF',
),
'CRSt' => array(
'descr' => 'Replace Select',
'colour' => 'FFA500',
),
'CSt' => array(
'descr' => 'Select',
'colour' => 'CC0000',
),
'CUe' => array(
'descr' => 'Update',
'colour' => '0000CC',
),
'CUMi' => array(
'descr' => 'Update Multiple',
'colour' => '0080C0',
),
);
$i = 0;
if (is_file($rrd_filename)) {
@@ -52,7 +52,8 @@ if (is_file($rrd_filename)) {
// $rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else {
}
else {
echo "file missing: $file";
}
@@ -7,15 +7,15 @@ $nototal = (($width < 224) ? 1 : 0);
$unit_text = 'Packets';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-ntpdserver-'.$app['app_id'].'.rrd';
$array = array(
'packets_drop' => array(
'descr' => 'Dropped',
'colour' => '880000FF',
),
'packets_ignore' => array(
'descr' => 'Ignored',
'colour' => 'FF8800FF',
),
);
'packets_drop' => array(
'descr' => 'Dropped',
'colour' => '880000FF',
),
'packets_ignore' => array(
'descr' => 'Ignored',
'colour' => 'FF8800FF',
),
);
$i = 0;
@@ -25,8 +25,7 @@ $files = array();
$i = 0;
if ($handle = opendir($rrddir)) {
while (false !== ($file = readdir($handle)))
{
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
array_push($files, $file);
@@ -13,8 +13,7 @@ $i = 0;
$x = 0;
if ($handle = opendir($rrddir)) {
while (false !== ($file = readdir($handle)))
{
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
if (eregi('app-shoutcast-'.$app['app_id'], $file)) {
array_push($files, $file);
@@ -1,19 +1,21 @@
<?php
/* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
/*
* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
/*
* TinyDNS DNSSec Graph
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
@@ -22,28 +24,31 @@
* @subpackage Graphs
*/
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = "Query/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-tinydns-".$app['app_id'].".rrd";
//$array = explode(":","hinfo:rp:sig:key:axfr:total");
$array = array( "key", "sig" );
$colours = "mixed";
$rrd_list = array();
$unit_text = 'Query/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-tinydns-'.$app['app_id'].'.rrd';
// $array = explode(":","hinfo:rp:sig:key:axfr:total");
$array = array(
'key',
'sig',
);
$colours = 'mixed';
$rrd_list = array();
if( is_file($rrd_filename) ) {
foreach( $array as $ds ) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else {
echo "file missing: $file";
if (is_file($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
@@ -1,19 +1,21 @@
<?php
/* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
/*
Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
/*
* TinyDNS Error Graph
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
@@ -22,27 +24,32 @@
* @subpackage Graphs
*/
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = "Query/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-tinydns-".$app['app_id'].".rrd";
$array = array( "notauth", "notimpl", "badclass", "noquery" );
$colours = "oranges";
$unit_text = 'Query/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-tinydns-'.$app['app_id'].'.rrd';
$array = array(
'notauth',
'notimpl',
'badclass',
'noquery',
);
$colours = 'oranges';
$rrd_list = array();
if( is_file($rrd_filename) ) {
foreach( $array as $ds ) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else {
echo "file missing: $file";
if (is_file($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
@@ -1,19 +1,21 @@
<?php
/* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
/*
Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
/*
* TinyDNS Other Graph
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
@@ -22,27 +24,32 @@
* @subpackage Graphs
*/
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = "Query/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-tinydns-".$app['app_id'].".rrd";
$array = array( "other", "hinfo", "rp", "axfr" );
$colours = "mixed";
$unit_text = 'Query/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-tinydns-'.$app['app_id'].'.rrd';
$array = array(
'other',
'hinfo',
'rp',
'axfr',
);
$colours = 'mixed';
$rrd_list = array();
if( is_file($rrd_filename) ) {
foreach( $array as $ds ) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else {
echo "file missing: $file";
if (is_file($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
@@ -1,19 +1,21 @@
<?php
/* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
/*
* Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
/*
* TinyDNS Query Graph
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
@@ -22,30 +24,40 @@
* @subpackage Graphs
*/
include("includes/graphs/common.inc.php");
require 'includes/graphs/common.inc.php';
$i = 0;
$scale_min = 0;
$nototal = 1;
$unit_text = "Query/sec";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-tinydns-".$app['app_id'].".rrd";
//$array = explode(":","hinfo:rp:sig:key:axfr:total");
$array = array( "any", "a", "aaaa", "cname", "mx", "ns", "ptr", "soa", "txt" );
$colours = "merged";
$rrd_list = array();
$unit_text = 'Query/sec';
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-tinydns-'.$app['app_id'].'.rrd';
// $array = explode(":","hinfo:rp:sig:key:axfr:total");
$array = array(
'any',
'a',
'aaaa',
'cname',
'mx',
'ns',
'ptr',
'soa',
'txt',
);
$colours = 'merged';
$rrd_list = array();
$config['graph_colours']['merged'] = array_merge($config['graph_colours']['greens'], $config['graph_colours']['blues']);
if( is_file($rrd_filename) ) {
foreach( $array as $ds ) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
} else {
echo "file missing: $file";
if (is_file($rrd_filename)) {
foreach ($array as $ds) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = strtoupper($ds);
$rrd_list[$i]['ds'] = $ds;
$i++;
}
}
else {
echo "file missing: $file";
}
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';