diff --git a/html/includes/graphs/application/tinydns_dnssec.inc.php b/html/includes/graphs/application/tinydns_dnssec.inc.php new file mode 100644 index 000000000..14b4c8136 --- /dev/null +++ b/html/includes/graphs/application/tinydns_dnssec.inc.php @@ -0,0 +1,49 @@ + + * 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 . */ + +/** + * TinyDNS DNSSec Graph + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Graphs + */ + +include("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(); + +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"); +?> diff --git a/html/includes/graphs/application/tinydns_errors.inc.php b/html/includes/graphs/application/tinydns_errors.inc.php new file mode 100644 index 000000000..6cec421c9 --- /dev/null +++ b/html/includes/graphs/application/tinydns_errors.inc.php @@ -0,0 +1,48 @@ + + * 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 . */ + +/** + * TinyDNS Error Graph + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Graphs + */ + +include("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"; +$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"; +} + +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +?> diff --git a/html/includes/graphs/application/tinydns_other.inc.php b/html/includes/graphs/application/tinydns_other.inc.php new file mode 100644 index 000000000..b7c08f88e --- /dev/null +++ b/html/includes/graphs/application/tinydns_other.inc.php @@ -0,0 +1,48 @@ + + * 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 . */ + +/** + * TinyDNS Other Graph + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Graphs + */ + +include("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"; +$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"; +} + +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +?> diff --git a/html/includes/graphs/application/tinydns_queries.inc.php b/html/includes/graphs/application/tinydns_queries.inc.php new file mode 100644 index 000000000..2d2b03ebe --- /dev/null +++ b/html/includes/graphs/application/tinydns_queries.inc.php @@ -0,0 +1,51 @@ + + * 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 . */ + +/** + * TinyDNS Query Graph + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Graphs + */ + +include("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(); + +$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"; +} + +include("includes/graphs/generic_multi_simplex_seperated.inc.php"); +?> diff --git a/html/pages/device/apps/tinydns.inc.php b/html/pages/device/apps/tinydns.inc.php new file mode 100644 index 000000000..fcf2a6b64 --- /dev/null +++ b/html/pages/device/apps/tinydns.inc.php @@ -0,0 +1,38 @@ + + * 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 . */ + +/** + * TinyDNS Application + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Apps + */ + +global $config; +$graphs = array('tinydns_queries' => 'Queries', 'tinydns_errors' => 'Errors', 'tinydns_dnssec' => 'DNSSec', 'tinydns_other' => 'Other'); +foreach( $graphs as $key => $text ) { + $graph_type = $key; + $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 "

$text

"; + include("includes/print-graphrow.inc.php"); + echo ""; +} +?> diff --git a/includes/polling/applications/tinydns.inc.php b/includes/polling/applications/tinydns.inc.php new file mode 100644 index 000000000..f676c35b5 --- /dev/null +++ b/includes/polling/applications/tinydns.inc.php @@ -0,0 +1,53 @@ + + * 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 . */ + +/** + * TinyDNS Statistics + * @author Daniel Preussker + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Polling + */ + +if( !empty($agent_data['app']['tinydns']) && $app['app_id'] > 0 ) { + echo " tinydns "; + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-tinydns-".$app['app_id'].".rrd"; + if( !is_file($rrd_filename) ) { + rrdtool_create($rrd_filename, "--step 300 \ + DS:a:COUNTER:600:0:125000000000 \ + DS:ns:COUNTER:600:0:125000000000 \ + DS:cname:COUNTER:600:0:125000000000 \ + DS:soa:COUNTER:600:0:125000000000 \ + DS:ptr:COUNTER:600:0:125000000000 \ + DS:hinfo:COUNTER:600:0:125000000000 \ + DS:mx:COUNTER:600:0:125000000000 \ + DS:txt:COUNTER:600:0:125000000000 \ + DS:rp:COUNTER:600:0:125000000000 \ + DS:sig:COUNTER:600:0:125000000000 \ + DS:key:COUNTER:600:0:125000000000 \ + DS:aaaa:COUNTER:600:0:125000000000 \ + DS:axfr:COUNTER:600:0:125000000000 \ + DS:any:COUNTER:600:0:125000000000 \ + DS:total:COUNTER:600:0:125000000000 \ + DS:other:COUNTER:600:0:125000000000 \ + DS:notauth:COUNTER:600:0:125000000000 \ + DS:notimpl:COUNTER:600:0:125000000000 \ + DS:badclass:COUNTER:600:0:125000000000 \ + DS:noquery:COUNTER:600:0:125000000000 ".$config['rrd_rra']); + } + rrdtool_update($rrd_filename, "N:".$agent_data['app']['tinydns']); +} +?> diff --git a/includes/polling/unix-agent.inc.php b/includes/polling/unix-agent.inc.php index ac4623cb4..12f6a6016 100755 --- a/includes/polling/unix-agent.inc.php +++ b/includes/polling/unix-agent.inc.php @@ -43,6 +43,7 @@ if ($device['os_group'] == "unix") if ($section == "apache") { $sa = "app"; $sb = "apache"; } if ($section == "mysql") { $sa = "app"; $sb = "mysql"; } if ($section == "nginx") { $sa = "app"; $sb = "nginx"; } + if ($section == "tinydns") { $sa = "app"; $sb = "tinydns"; } # if ($section == "drbd") { $sa = "app"; $sb = "drbd"; } if (!empty($sa) && !empty($sb)) diff --git a/scripts/agent-local/tinydns b/scripts/agent-local/tinydns new file mode 100755 index 000000000..9c980a80c --- /dev/null +++ b/scripts/agent-local/tinydns @@ -0,0 +1,18 @@ +#!/bin/bash +# (c) 2015, 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 . + +echo "<<>>" +head -n1 /service/dns/log/main/tinystats/tinystats.out +