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

@@ -0,0 +1,30 @@
<?php
/**
* powerdns-recursor.inc.php
*
* -Description-
*
* 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>
*/
$rrd = rrd_name($device['hostname'], array('app', 'powerdns-recursor', $app['app_id']));
if (is_file($rrd)) {
$rrd_filename = $rrd;
}
$simple_rrd = true;

View File

@@ -0,0 +1,64 @@
<?php
/**
* powerdns-recursor_answers.inc.php
*
* Graph of answers
*
* 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>
*/
include 'powerdns-recursor.inc.php';
$colours = 'oranges';
$unit_text = 'Answers/sec';
$print_total = true;
if (is_file($rrd_filename)) {
$rrd_list = array(
array(
'ds' => 'answers0-1',
'filename' => $rrd_filename,
'descr' => '0-1ms',
),
array(
'ds' => 'answers1-10',
'filename' => $rrd_filename,
'descr' => '1-10ms',
),
array(
'ds' => 'answers10-100',
'filename' => $rrd_filename,
'descr' => '10-100ms',
),
array(
'ds' => 'answers100-1000',
'filename' => $rrd_filename,
'descr' => '100-1000ms',
),
array(
'ds' => 'answers-slow',
'filename' => $rrd_filename,
'descr' => '>1s',
),
);
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_multi.inc.php';

View File

@@ -0,0 +1,65 @@
<?php
/**
* powerdns-recursor_cache_performance.inc.php
*
* -Description-
*
* 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>
*/
include 'powerdns-recursor.inc.php';
$colours = 'mixed';
$unit_text = 'Packets/sec';
if (is_file($rrd_filename)) {
$rrd_list = array(
array(
'filename' => $rrd_filename,
'ds' => 'cache-hits',
'descr' => 'Query Cache Hits',
'colour' => '297159',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'cache-misses',
'descr' => 'Query Cache Misses',
'colour' => '73AC61',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'packetcache-hits',
'descr' => 'Packet Cache Hits',
'colour' => 'BC7049',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'packetcache-misses',
'descr' => 'Packet Cache Misses',
'colour' => 'C98F45',
'area' => true,
)
);
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -0,0 +1,50 @@
<?php
/**
* powerdns-recursor_cache_size.inc.php
*
* -Description-
*
* 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>
*/
include 'powerdns-recursor.inc.php';
$colours = 'purples';
$unit_text = 'Entries';
if (is_file($rrd_filename)) {
$rrd_list = array(
array(
'filename' => $rrd_filename,
'ds' => 'cache-entries',
'descr' => 'Query Cache',
'colour' => '202048',
),
array(
'filename' => $rrd_filename,
'ds' => 'packetcache-entries',
'descr' => 'Packet Cache',
'colour' => 'CC7CCC',
)
);
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -0,0 +1,68 @@
<?php
/**
* powerdns-recursor_outqueries.inc.php
*
* -Description-
*
* 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>
*/
include 'powerdns-recursor.inc.php';
$colours = 'mixed';
$unit_text = 'Queries/sec';
if (is_file($rrd_filename)) {
$rrd_list = array(
array(
'filename' => $rrd_filename,
'ds' => 'all-outqueries',
'descr' => 'Total',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'ipv6-outqueries',
'descr' => 'IPv6',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'tcp-outqueries',
'descr' => 'TCP',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'throttled-out',
'descr' => 'Throttled',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'outgoing-timeouts',
'descr' => 'Timeouts',
'area' => true,
)
);
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_multi_line.inc.php';

View File

@@ -0,0 +1,68 @@
<?php
/**
* powerdns-recursor_questions.inc.php
*
* -Description-
*
* 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>
*/
include 'powerdns-recursor.inc.php';
$colours = 'mixed';
$unit_text = 'Questions/sec';
if (is_file($rrd_filename)) {
$rrd_list = array(
array(
'filename' => $rrd_filename,
'ds' => 'questions',
'descr' => 'Total Questions',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'ipv6-questions',
'descr' => 'IPv6 Questions',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'tcp-questions',
'descr' => 'TCP Questions',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'over-capacity-drops',
'descr' => 'Over Capacity Drops',
'area' => true,
),
array(
'filename' => $rrd_filename,
'ds' => 'policy-drops',
'descr' => 'Policy Drops',
'area' => true,
)
);
} else {
echo "file missing: $rrd_filename";
}
require 'includes/graphs/generic_multi_line.inc.php';