Merge pull request #3869 from murrant/app-pdns-recursor

New App: Powerdns Recursor
This commit is contained in:
Neil Lathwood
2016-07-26 20:51:19 +01:00
committed by GitHub
12 changed files with 612 additions and 10 deletions

View File

@@ -33,6 +33,13 @@ $graphs['nginx'] = array(
'req',
);
$graphs['powerdns-recursor'] = array(
'questions',
'answers',
'cache_performance',
'outqueries'
);
$graphs['rrdcached'] = array(
'queue_length',
'events',

View File

@@ -0,0 +1,53 @@
<?php
/**
* powerdns-recursor.php
*
* Graphs for PowerDNS Recursor
*
* 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/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
global $config;
$graphs = array(
'powerdns-recursor_questions' => 'Questions',
'powerdns-recursor_answers' => 'Answers',
'powerdns-recursor_cache_performance' => 'Cache Performance',
'powerdns-recursor_cache_size' => 'Cache Size',
'powerdns-recursor_outqueries' => 'Outbound Queries',
);
foreach ($graphs as $key => $text) {
$graph_array['height'] = '100';
$graph_array['width'] = '215';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = 'application_'.$key;
echo '<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">'.$text.'</h3>
</div>
<div class="panel-body">
<div class="row">';
include 'includes/print-graphrow.inc.php';
echo '</div>';
echo '</div>';
echo '</div>';
}