1<?php
2/*
3 * Copyright (C) 2015 Daniel Preussker <f0o@devilcode.org>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Bind9 Query Graph
20 * @author Daniel Preussker <f0o@devilcode.org>
21 * @copyright 2015 f0o, LibreNMS
22 * @license GPL
23 * @package LibreNMS
24 * @subpackage Graphs
25 */
26
27$unitlen = 10;
28$bigdescrlen = 9;
29$smalldescrlen = 9;
30$dostack = 0;
31$printtotal = 0;
32$unit_text = 'query/sec';
33$colours = 'psychedelic';
34$rrd_list = [];
35
36$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id']]);
37$array = [
38    'any',
39    'a',
40    'aaaa',
41    'cname',
42    'mx',
43    'ns',
44    'ptr',
45    'soa',
46    'srv',
47    'spf',
48];
49if (Rrd::checkRrdExists($rrd_filename)) {
50    foreach ($array as $ds) {
51        $rrd_list[] = [
52            'filename' => $rrd_filename,
53            'descr' => strtoupper($ds),
54            'ds' => $ds,
55        ];
56    }
57} else {
58    echo "file missing: $file";
59}
60
61$rrd_filename = Rrd::name($device['hostname'], ['app', 'bind', $app['app_id'], 'incoming']);
62$array = [
63    'afsdb',
64    'apl',
65    'caa',
66    'cdnskey',
67    'cds',
68    'cert',
69    'dhcid',
70    'dlv',
71    'dnskey',
72    'ds',
73    'ipseckey',
74    'key',
75    'kx',
76    'loc',
77    'naptr',
78    'nsec',
79    'nsec3',
80    'nsec3param',
81    'rrsig',
82    'rp',
83    'sig',
84    'sshfp',
85    'ta',
86    'tkey',
87    'tlsa',
88    'tsig',
89    'txt',
90    'uri',
91    'dname',
92    'axfr',
93    'ixfr',
94    'opt',
95];
96if (Rrd::checkRrdExists($rrd_filename)) {
97    foreach ($array as $ds) {
98        $rrd_list[] = [
99            'filename' => $rrd_filename,
100            'descr' => strtoupper($ds),
101            'ds' => $ds,
102        ];
103    }
104} else {
105    echo "file missing: $file";
106}
107
108require 'includes/html/graphs/generic_multi_line.inc.php';
109