New App: Powerdns Recursor

Polling must have access to stats for the device, port 8082 (Agent file could be added to avoid that)

**Graphs:**
Questions
Answers
Cache Performance
Cache Size
Outbound Queries

**Graph changes**
generic_multi:print_total added, allow per-dataset colors, document variables
generic_multi_line: allow per-dataset colors, document variables
This commit is contained in:
Tony Murray
2016-07-22 14:29:29 -05:00
parent 5ca2eab0dc
commit 94467671b3
11 changed files with 600 additions and 10 deletions

View File

@@ -1,5 +1,22 @@
<?php
/*
* Outputs a graph with multiple overlaid lines
*
* Variables:
* $rrd_list array required - array of data sets to graph. Each item is an array that contains the following
* ds string required - data set name as defined in rrd
* filename string required - path to the rrd file as generated by rrd_name()
* descr string required - the label for this data set
* colour string optional - Defines the colour for this data set (overrides the overall colour set)
* area boolean optional - Colors in the area of the data set with 20% opacity (unless areacolor is set)
* areacolor string optional - Sets the area color manually
* invert boolean optional - multiplies values in this data set by -1
* $colours string required - colour set as defined in $config['graph_colours']
* $print_total boolean optional - Sum all the values and output the last, min, max, and avg in the legend
* $simplerrd boolean optional - All data sets reside in the same rrd file
*/
require 'includes/graphs/common.inc.php';
if ($width > '500') {
@@ -31,11 +48,17 @@ $i = 0;
$iter = 0;
foreach ($rrd_list as $rrd) {
if (!$config['graph_colours'][$colours][$iter]) {
$iter = 0;
// get the color for this data set
if(isset($rrd['colour'])) {
$colour = $rrd['colour'];
} else {
if (!$config['graph_colours'][$colours][$iter]) {
$iter = 0;
}
$colour = $config['graph_colours'][$colours][$iter];
$iter++;
}
$colour = $config['graph_colours'][$colours][$iter];
if (!empty($rrd['area']) && empty($rrd['areacolour'])) {
$rrd['areacolour'] = $colour."20";
}
@@ -76,7 +99,6 @@ foreach ($rrd_list as $rrd) {
$rrd_optionsb .= ' GPRINT:'.$id.'max:MAX:%5.2lf%s'.$units.' GPRINT:'.$id.":AVERAGE:'%5.2lf%s$units\\n'";
$i++;
$iter++;
}//end foreach
$rrd_options .= $rrd_optionsb;