1 <?xml version="1.0" encoding="UTF-8"?>
3 - Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
5 - Permission to use, copy, modify, and/or distribute this software for any
6 - purpose with or without fee is hereby granted, provided that the above
7 - copyright notice and this permission notice appear in all copies.
9 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 - PERFORMANCE OF THIS SOFTWARE.
20 <!-- %Id: bind9.xsl,v 1.21 2009/01/27 23:47:54 tbox Exp % -->
21 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
22 <xsl:output method="html" indent="yes" version="4.0"/>
23 <xsl:template match="statistics[@version="3.3"]">
26 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
27 <!-- Non Mozilla specific markup -->
28 <script type="text/javascript" src="https://www.google.com/jsapi"/>
29 <script type="text/javascript">
31 google.load("visualization", "1", {packages:["corechart"]});
32 google.setOnLoadCallback(loadGraphs);
36 function drawChart(chart_title,target,style,data) {
37 var data = google.visualization.arrayToDataTable(data);
44 if (style == "barchart") {
45 chart = new google.visualization.BarChart(document.getElementById(target));
46 chart.draw(data, options);
47 } else if (style == "piechart") {
48 chart = new google.visualization.PieChart(document.getElementById(target));
49 chart.draw(data, options);
53 function loadGraphs(){
56 while(g = graphs.shift()){
57 // alert("going for: " + g.target);
58 if(g.data.length > 1){
59 drawChart(g.title,g.target,g.style,g.data);
64 // Server Incoming Query Types
66 'title' : "Server Incoming Query Types",
67 'target': 'chart_incoming_qtypes',
69 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type="qtype"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
72 // Server Incoming Requests by opcode
74 'title' : "Server Incoming Requests by DNS Opcode",
75 'target': 'chart_incoming_opcodes',
77 'data': [['Opcode','Counter'],<xsl:for-each select="server/counters[@type="opcode"]/counter[. > 0 or substring(@name,1,3) != 'RES']">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]});
80 <style type="text/css">
82 font-family: sans-serif;
83 background-color: #ffffff;
89 background-color: #f0f0f0;
93 background-color: #ffffff;
102 border-collapse: collapse;
103 border: 1px solid grey;
107 border: 1px solid grey;
112 border: 1px solid grey;
117 font-family: monospace;
119 table.counters tr:hover{
120 background-color: #99ddff;
124 border: 1px solid grey;
129 border: 1px solid grey;
136 background-color: #99ddff;
140 border: 1px solid grey;
145 border: 1px solid grey;
150 font-family: monospace;
152 table.tasks td:nth-child(2) {
155 table.tasks td:nth-child(4) {
158 table.tasks tr:hover{
159 background-color: #99ddff;
163 border: 1px solid grey;
168 border: 1px solid grey;
174 table.netstat td:nth-child(4) {
176 font-family: monospace;
178 table.netstat td:nth-child(7) {
181 table.netstat tr:hover{
182 background-color: #99ddff;
186 border: 1px solid grey;
191 border: 1px solid grey;
195 font-family: monospace;
197 table.mctx td:nth-child(-n+2) {
202 background-color: #99ddff;
206 background-color: rgb(1,169,206);
213 border: 1px solid grey;
217 color: rgb(1,169,206);
222 background-color: #ffffff;
252 color: rgb(1,169,206);
264 <title>ISC BIND 9 Statistics</title>
268 <h1>ISC Bind 9 Configuration and Statistics</h1>
271 <h2>Server Times</h2>
276 <xsl:value-of select="server/boot-time"/>
280 <th>Current time:</th>
282 <xsl:value-of select="server/current-time"/>
287 <xsl:if test="server/counters[@type="opcode"]/counter[. > 0]">
288 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
289 <h2>Incoming Requests by DNS Opcode</h2>
290 <!-- Non Mozilla specific markup -->
291 <div class="pie" id="chart_incoming_opcodes">
292 [cannot display chart]
295 <table class="counters">
296 <xsl:for-each select="server/counters[@type="opcode"]/counter[. > 0 or substring(@name,1,3) != 'RES']">
297 <xsl:sort select="." data-type="number" order="descending"/>
300 <xsl:value-of select="@name"/>
303 <xsl:value-of select="."/>
308 <th class="totals">Total:</th>
310 <xsl:value-of select="sum(server/counters[@type="opcode"]/counter)"/>
316 <xsl:if test="server/counters[@type="qtype"]/counter">
317 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
318 <!-- Non Mozilla specific markup -->
319 <h3>Incoming Queries by Query Type</h3>
320 <div class="pie" id="chart_incoming_qtypes">
321 [cannot display chart]
324 <table class="counters">
325 <xsl:for-each select="server/counters[@type="qtype"]/counter">
326 <xsl:sort select="." data-type="number" order="descending"/>
327 <xsl:variable name="css-class">
329 <xsl:when test="position() mod 2 = 0">even</xsl:when>
330 <xsl:otherwise>odd</xsl:otherwise>
333 <tr class="{$css-class}">
335 <xsl:value-of select="@name"/>
338 <xsl:value-of select="."/>
343 <th class="totals">Total:</th>
345 <xsl:value-of select="sum(server/counters[@type="qtype"]/counter)"/>
351 <xsl:if test="views/view[count(counters[@type="resqtype"]/counter) > 0]">
352 <h2>Outgoing Queries per view</h2>
353 <xsl:for-each select="views/view[count(counters[@type="resqtype"]/counter) > 0]">
354 <h3>View <xsl:value-of select="@name"/></h3>
355 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
356 <!-- Non Mozilla specific markup -->
357 <script type="text/javascript">
359 'title': "Outgoing Queries for view: <xsl:value-of select="@name"/>",
360 'target': 'chart_outgoing_queries_view_<xsl:value-of select="@name"/>',
362 'data': [['Type','Counter'],<xsl:for-each select="counters[@type="resqtype"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
365 <xsl:variable name="target">
366 <xsl:value-of select="@name"/>
368 <div class="pie" id="chart_outgoing_queries_view_{$target}">[no data to display]</div>
370 <table class="counters">
371 <xsl:for-each select="counters[@type="resqtype"]/counter">
372 <xsl:sort select="." data-type="number" order="descending"/>
373 <xsl:variable name="css-class1">
375 <xsl:when test="position() mod 2 = 0">even</xsl:when>
376 <xsl:otherwise>odd</xsl:otherwise>
379 <tr class="{$css-class1}">
381 <xsl:value-of select="@name"/>
384 <xsl:value-of select="."/>
392 <xsl:if test="server/counters[@type="nsstat"]/counter[.>0]">
393 <h2>Server Statistics</h2>
394 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
395 <!-- Non Mozilla specific markup -->
396 <script type="text/javascript">
398 'title' : "Server Counters",
399 'target': 'chart_server_nsstat_restype',
401 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type="nsstat"]/counter[.>0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
404 <div class="pie" id="chart_server_nsstat_restype">[no data to display]</div>
406 <table class="counters">
407 <xsl:for-each select="server/counters[@type="nsstat"]/counter[.>0]">
408 <xsl:sort select="." data-type="number" order="descending"/>
409 <xsl:variable name="css-class2">
411 <xsl:when test="position() mod 2 = 0">even</xsl:when>
412 <xsl:otherwise>odd</xsl:otherwise>
415 <tr class="{$css-class2}">
417 <xsl:value-of select="@name"/>
420 <xsl:value-of select="."/>
427 <xsl:if test="server/counters[@type="zonestat"]/counter[.>0]">
428 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
429 <h2>Zone Maintenance Statistics</h2>
430 <script type="text/javascript">
432 'title' : "Zone Maintenance Stats",
433 'target': 'chart_server_zone_maint',
435 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type="zonestat"]/counter[.>0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
438 <!-- Non Mozilla specific markup -->
439 <div class="pie" id="chart_server_zone_maint">[no data to display]</div>
441 <table class="counters">
442 <xsl:for-each select="server/counters[@type="zonestat"]/counter">
443 <xsl:sort select="." data-type="number" order="descending"/>
444 <xsl:variable name="css-class3">
446 <xsl:when test="position() mod 2 = 0">even</xsl:when>
447 <xsl:otherwise>odd</xsl:otherwise>
450 <tr class="{$css-class3}">
452 <xsl:value-of select="@name"/>
455 <xsl:value-of select="."/>
461 <xsl:if test="server/counters[@type="resstat"]/counter[.>0]">
462 <h2>Resolver Statistics (Common)</h2>
463 <table class="counters">
464 <xsl:for-each select="server/counters[@type="resstat"]/counter">
465 <xsl:sort select="." data-type="number" order="descending"/>
466 <xsl:variable name="css-class4">
468 <xsl:when test="position() mod 2 = 0">even</xsl:when>
469 <xsl:otherwise>odd</xsl:otherwise>
472 <tr class="{$css-class4}">
474 <xsl:value-of select="@name"/>
477 <xsl:value-of select="."/>
483 <xsl:for-each select="views/view">
484 <xsl:if test="counters[@type="resstats"]/counter[.>0]">
485 <h3>Resolver Statistics for View <xsl:value-of select="@name"/></h3>
486 <table class="counters">
487 <xsl:for-each select="counters[@type="resstats"]/counter[.>0]">
488 <xsl:sort select="." data-type="number" order="descending"/>
489 <xsl:variable name="css-class5">
491 <xsl:when test="position() mod 2 = 0">even</xsl:when>
492 <xsl:otherwise>odd</xsl:otherwise>
495 <tr class="{$css-class5}">
497 <xsl:value-of select="@name"/>
500 <xsl:value-of select="."/>
508 <xsl:for-each select="views/view">
509 <xsl:if test="cache/rrset">
510 <h3>Cache DB RRsets for View <xsl:value-of select="@name"/></h3>
511 <table class="counters">
512 <xsl:for-each select="cache/rrset">
513 <xsl:variable name="css-class6">
515 <xsl:when test="position() mod 2 = 0">even</xsl:when>
516 <xsl:otherwise>odd</xsl:otherwise>
519 <tr class="{$css-class6}">
521 <xsl:value-of select="name"/>
524 <xsl:value-of select="counter"/>
533 <xsl:if test="server/counters[@type="sockstat"]/counter[.>0]">
534 <h2>Socket I/O Statistics</h2>
535 <table class="counters">
536 <xsl:for-each select="server/counters[@type="sockstat"]/counter[.>0]">
537 <xsl:variable name="css-class7">
539 <xsl:when test="position() mod 2 = 0">even</xsl:when>
540 <xsl:otherwise>odd</xsl:otherwise>
543 <tr class="{$css-class7}">
545 <xsl:value-of select="@name"/>
548 <xsl:value-of select="."/>
555 <xsl:if test="views/view[zones/zone/counters[@type="rcode"]/counter >0]">
556 <h2>Response Codes per view/zone</h2>
557 <xsl:for-each select="views/view[zones/zone/counters[@type="rcode"]/counter >0]">
558 <h3>View <xsl:value-of select="@name"/></h3>
559 <xsl:variable name="thisview">
560 <xsl:value-of select="@name"/>
562 <xsl:for-each select="zones/zone">
563 <xsl:if test="counters[@type="rcode"]/counter[. > 0]">
564 <h4>Zone <xsl:value-of select="@name"/></h4>
565 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
566 <!-- Non Mozilla specific markup -->
567 <script type="text/javascript">
569 'title': "Response Codes for zone <xsl:value-of select="@name"/>",
570 'target': 'chart_rescode_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
572 'data': [['Type','Counter'],<xsl:for-each select="counters[@type="rcode"]/counter[.>0 and @name != "QryAuthAns"]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
576 <xsl:variable name="target">
577 <xsl:value-of select="@name"/>
579 <div class="pie" id="chart_rescode_{$thisview}_{$target}">[no data to display]</div>
581 <table class="counters">
582 <xsl:for-each select="counters[@type="rcode"]/counter[.>0 and @name != "QryAuthAns"]">
583 <xsl:sort select="."/>
584 <xsl:variable name="css-class10">
586 <xsl:when test="position() mod 2 = 0">even</xsl:when>
587 <xsl:otherwise>odd</xsl:otherwise>
590 <tr class="{$css-class10}">
592 <xsl:value-of select="@name"/>
595 <xsl:value-of select="."/>
604 <xsl:if test="views/view[zones/zone/counters[@type="qtype"]/counter >0]">
605 <h2>Received QTYPES per view/zone</h2>
606 <xsl:for-each select="views/view[zones/zone/counters[@type="qtype"]/counter >0]">
607 <h3>View <xsl:value-of select="@name"/></h3>
608 <xsl:variable name="thisview2">
609 <xsl:value-of select="@name"/>
611 <xsl:for-each select="zones/zone">
612 <xsl:if test="counters[@type="qtype"]/counter[count(.) > 0]">
613 <h4>Zone <xsl:value-of select="@name"/></h4>
614 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
615 <!-- Non Mozilla specific markup -->
616 <script type="text/javascript">
618 'title': "Query Types for zone <xsl:value-of select="@name"/>",
619 'target': 'chart_qtype_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
621 'data': [['Type','Counter'],<xsl:for-each select="counters[@type="qtype"]/counter[.>0 and @name != "QryAuthAns"]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
625 <xsl:variable name="target">
626 <xsl:value-of select="@name"/>
628 <div class="pie" id="chart_qtype_{$thisview2}_{$target}">[no data to display]</div>
630 <table class="counters">
631 <xsl:for-each select="counters[@type="qtype"]/counter">
632 <xsl:sort select="."/>
633 <xsl:variable name="css-class11">
635 <xsl:when test="position() mod 2 = 0">even</xsl:when>
636 <xsl:otherwise>odd</xsl:otherwise>
639 <tr class="{$css-class11}">
641 <xsl:value-of select="@name"/>
644 <xsl:value-of select="."/>
653 <xsl:if test="socketmgr/sockets/socket">
654 <h2>Network Status</h2>
655 <table class="netstat">
661 <th>LocalAddress</th>
665 <xsl:for-each select="socketmgr/sockets/socket">
666 <xsl:sort select="id"/>
667 <xsl:variable name="css-class12">
669 <xsl:when test="position() mod 2 = 0">even</xsl:when>
670 <xsl:otherwise>odd</xsl:otherwise>
673 <tr class="{$css-class12}">
675 <xsl:value-of select="id"/>
678 <xsl:value-of select="name"/>
681 <xsl:value-of select="type"/>
684 <xsl:value-of select="references"/>
687 <xsl:value-of select="local-address"/>
690 <xsl:value-of select="peer-address"/>
693 <xsl:for-each select="states">
694 <xsl:value-of select="."/>
702 <xsl:if test="taskmgr/thread-model/type">
703 <h2>Task Manager Configuration</h2>
704 <table class="counters">
706 <th class="even">Thread-Model</th>
708 <xsl:value-of select="taskmgr/thread-model/type"/>
712 <th>Worker Threads</th>
714 <xsl:value-of select="taskmgr/thread-model/worker-threads"/>
718 <th>Default Quantum</th>
720 <xsl:value-of select="taskmgr/thread-model/default-quantum"/>
724 <th>Tasks Running</th>
726 <xsl:value-of select="taskmgr/thread-model/tasks-running"/>
732 <xsl:if test="taskmgr/tasks/task">
734 <table class="tasks">
742 <xsl:for-each select="taskmgr/tasks/task">
743 <xsl:sort select="name"/>
744 <xsl:variable name="css-class14">
746 <xsl:when test="position() mod 2 = 0">even</xsl:when>
747 <xsl:otherwise>odd</xsl:otherwise>
750 <tr class="{$css-class14}">
752 <xsl:value-of select="id"/>
755 <xsl:value-of select="name"/>
758 <xsl:value-of select="references"/>
761 <xsl:value-of select="state"/>
764 <xsl:value-of select="quantum"/>
771 <xsl:if test="memory/summary">
772 <h2>Memory Usage Summary</h2>
773 <table class="counters">
774 <xsl:for-each select="memory/summary/*">
775 <xsl:variable name="css-class13">
777 <xsl:when test="position() mod 2 = 0">even</xsl:when>
778 <xsl:otherwise>odd</xsl:otherwise>
781 <tr class="{$css-class13}">
783 <xsl:value-of select="name()"/>
786 <xsl:value-of select="."/>
793 <xsl:if test="memory/contexts/context">
794 <h2>Memory Contexts</h2>
808 <xsl:for-each select="memory/contexts/context">
809 <xsl:sort select="total" data-type="number" order="descending"/>
810 <xsl:variable name="css-class14">
812 <xsl:when test="position() mod 2 = 0">even</xsl:when>
813 <xsl:otherwise>odd</xsl:otherwise>
816 <tr class="{$css-class14}">
818 <xsl:value-of select="id"/>
821 <xsl:value-of select="name"/>
824 <xsl:value-of select="references"/>
827 <xsl:value-of select="total"/>
830 <xsl:value-of select="inuse"/>
833 <xsl:value-of select="maxinuse"/>
836 <xsl:value-of select="blocksize"/>
839 <xsl:value-of select="pools"/>
842 <xsl:value-of select="hiwater"/>
845 <xsl:value-of select="lowater"/>
852 <p class="footer">Internet Systems Consortium Inc.<br/><a href="http://www.isc.org">http://www.isc.org</a></p>