1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 - Copyright (C) 2006-2009, 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.5"]">
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 <xsl:if test=
"server/counters[@type="qtype"]/counter">
65 // Server Incoming Query Types
67 'title' :
"Server Incoming Query Types",
68 'target': 'chart_incoming_qtypes',
70 'data': [['Type','Counter'],
<xsl:for-each select=
"server/counters[@type="qtype"]/counter">['
<xsl:value-of select=
"@name"/>',
<xsl:value-of select=
"."/>],
</xsl:for-each>]
74 <xsl:if test=
"server/counters[@type="opcode"]/counter">
75 // Server Incoming Requests by opcode
77 'title' :
"Server Incoming Requests by DNS Opcode",
78 'target': 'chart_incoming_opcodes',
80 '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>]});
84 <style type=
"text/css">
86 font-family: sans-serif;
87 background-color: #ffffff;
93 background-color: #f0f0f0;
97 background-color: #ffffff;
106 border-collapse: collapse;
107 border:
1px solid grey;
111 border:
1px solid grey;
116 border:
1px solid grey;
121 font-family: monospace;
123 table.counters tr:hover{
124 background-color: #
99ddff;
128 border:
1px solid grey;
133 border:
1px solid grey;
140 background-color: #
99ddff;
144 border:
1px solid grey;
149 border:
1px solid grey;
154 font-family: monospace;
156 table.tasks td:nth-child(
2) {
159 table.tasks td:nth-child(
4) {
162 table.tasks tr:hover{
163 background-color: #
99ddff;
167 border:
1px solid grey;
172 border:
1px solid grey;
178 table.netstat td:nth-child(
4) {
180 font-family: monospace;
182 table.netstat td:nth-child(
7) {
185 table.netstat tr:hover{
186 background-color: #
99ddff;
190 border:
1px solid grey;
195 border:
1px solid grey;
199 font-family: monospace;
201 table.mctx td:nth-child(-n+
2) {
206 background-color: #
99ddff;
210 background-color: rgb(
1,
169,
206);
217 border:
1px solid grey;
221 color: rgb(
1,
169,
206);
226 background-color: #ffffff;
256 color: rgb(
1,
169,
206);
268 <title>ISC BIND
9 Statistics
</title>
272 <h1>ISC Bind
9 Configuration and Statistics
</h1>
274 <p>Alternate statistics views:
<a href=
"/">All
</a>,
275 <a href=
"/xml/v3/status">Status
</a>,
276 <a href=
"/xml/v3/server">Server
</a>,
277 <a href=
"/xml/v3/zones">Zones
</a>,
278 <a href=
"/xml/v3/net">Network
</a>,
279 <a href=
"/xml/v3/tasks">Tasks
</a> and
280 <a href=
"/xml/v3/mem">Memory
</a></p>
282 <h2>Server Status
</h2>
287 <xsl:value-of select=
"server/boot-time"/>
291 <th>Last reconfigured:
</th>
293 <xsl:value-of select=
"server/config-time"/>
297 <th>Current time:
</th>
299 <xsl:value-of select=
"server/current-time"/>
304 <xsl:if test=
"server/counters[@type="opcode"]/counter[. > 0]">
305 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
306 <h2>Incoming Requests by DNS Opcode
</h2>
307 <!-- Non Mozilla specific markup -->
308 <div class=
"pie" id=
"chart_incoming_opcodes">
309 [cannot display chart]
312 <table class=
"counters">
313 <xsl:for-each select=
"server/counters[@type="opcode"]/counter[. > 0 or substring(@name,1,3) != 'RES']">
314 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
317 <xsl:value-of select=
"@name"/>
320 <xsl:value-of select=
"."/>
325 <th class=
"totals">Total:
</th>
327 <xsl:value-of select=
"sum(server/counters[@type="opcode"]/counter)"/>
333 <xsl:if test=
"server/counters[@type="qtype"]/counter">
334 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
335 <!-- Non Mozilla specific markup -->
336 <h3>Incoming Queries by Query Type
</h3>
337 <div class=
"pie" id=
"chart_incoming_qtypes">
338 [cannot display chart]
341 <table class=
"counters">
342 <xsl:for-each select=
"server/counters[@type="qtype"]/counter">
343 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
344 <xsl:variable name=
"css-class">
346 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
347 <xsl:otherwise>odd
</xsl:otherwise>
350 <tr class=
"{$css-class}">
352 <xsl:value-of select=
"@name"/>
355 <xsl:value-of select=
"."/>
360 <th class=
"totals">Total:
</th>
362 <xsl:value-of select=
"sum(server/counters[@type="qtype"]/counter)"/>
368 <xsl:if test=
"views/view[count(counters[@type="resqtype"]/counter) > 0]">
369 <h2>Outgoing Queries per view
</h2>
370 <xsl:for-each select=
"views/view[count(counters[@type="resqtype"]/counter) > 0]">
371 <h3>View
<xsl:value-of select=
"@name"/></h3>
372 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
373 <!-- Non Mozilla specific markup -->
374 <script type=
"text/javascript">
376 'title':
"Outgoing Queries for view: <xsl:value-of select="@name
"/>",
377 'target': 'chart_outgoing_queries_view_
<xsl:value-of select=
"@name"/>',
379 'data': [['Type','Counter'],
<xsl:for-each select=
"counters[@type="resqtype"]/counter">['
<xsl:value-of select=
"@name"/>',
<xsl:value-of select=
"."/>],
</xsl:for-each>]
382 <xsl:variable name=
"target">
383 <xsl:value-of select=
"@name"/>
385 <div class=
"pie" id=
"chart_outgoing_queries_view_{$target}">[no data to display]
</div>
387 <table class=
"counters">
388 <xsl:for-each select=
"counters[@type="resqtype"]/counter">
389 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
390 <xsl:variable name=
"css-class1">
392 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
393 <xsl:otherwise>odd
</xsl:otherwise>
396 <tr class=
"{$css-class1}">
398 <xsl:value-of select=
"@name"/>
401 <xsl:value-of select=
"."/>
409 <xsl:if test=
"server/counters[@type="nsstat"]/counter[.>0]">
410 <h2>Server Statistics
</h2>
411 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
412 <!-- Non Mozilla specific markup -->
413 <script type=
"text/javascript">
415 'title' :
"Server Counters",
416 'target': 'chart_server_nsstat_restype',
418 '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>]
421 <div class=
"pie" id=
"chart_server_nsstat_restype">[no data to display]
</div>
423 <table class=
"counters">
424 <xsl:for-each select=
"server/counters[@type="nsstat"]/counter[.>0]">
425 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
426 <xsl:variable name=
"css-class2">
428 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
429 <xsl:otherwise>odd
</xsl:otherwise>
432 <tr class=
"{$css-class2}">
434 <xsl:value-of select=
"@name"/>
437 <xsl:value-of select=
"."/>
444 <xsl:if test=
"server/counters[@type="zonestat"]/counter[.>0]">
445 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
446 <h2>Zone Maintenance Statistics
</h2>
447 <script type=
"text/javascript">
449 'title' :
"Zone Maintenance Stats",
450 'target': 'chart_server_zone_maint',
452 '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>]
455 <!-- Non Mozilla specific markup -->
456 <div class=
"pie" id=
"chart_server_zone_maint">[no data to display]
</div>
458 <table class=
"counters">
459 <xsl:for-each select=
"server/counters[@type="zonestat"]/counter">
460 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
461 <xsl:variable name=
"css-class3">
463 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
464 <xsl:otherwise>odd
</xsl:otherwise>
467 <tr class=
"{$css-class3}">
469 <xsl:value-of select=
"@name"/>
472 <xsl:value-of select=
"."/>
478 <xsl:if test=
"server/counters[@type="resstat"]/counter[.>0]">
479 <h2>Resolver Statistics (Common)
</h2>
480 <table class=
"counters">
481 <xsl:for-each select=
"server/counters[@type="resstat"]/counter">
482 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
483 <xsl:variable name=
"css-class4">
485 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
486 <xsl:otherwise>odd
</xsl:otherwise>
489 <tr class=
"{$css-class4}">
491 <xsl:value-of select=
"@name"/>
494 <xsl:value-of select=
"."/>
500 <xsl:for-each select=
"views/view">
501 <xsl:if test=
"counters[@type="resstats"]/counter[.>0]">
502 <h3>Resolver Statistics for View
<xsl:value-of select=
"@name"/></h3>
503 <table class=
"counters">
504 <xsl:for-each select=
"counters[@type="resstats"]/counter[.>0]">
505 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
506 <xsl:variable name=
"css-class5">
508 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
509 <xsl:otherwise>odd
</xsl:otherwise>
512 <tr class=
"{$css-class5}">
514 <xsl:value-of select=
"@name"/>
517 <xsl:value-of select=
"."/>
524 <xsl:for-each select=
"views/view">
525 <xsl:if test=
"counters[@type="adbstat"]/counter[.>0]">
526 <h3>ADB Statistics for View
<xsl:value-of select=
"@name"/></h3>
527 <table class=
"counters">
528 <xsl:for-each select=
"counters[@type="adbstat"]/counter[.>0]">
529 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
530 <xsl:variable name=
"css-class5">
532 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
533 <xsl:otherwise>odd
</xsl:otherwise>
536 <tr class=
"{$css-class5}">
538 <xsl:value-of select=
"@name"/>
541 <xsl:value-of select=
"."/>
549 <xsl:for-each select=
"views/view">
550 <xsl:if test=
"counters[@type="cachestats"]/counter[.>0]">
551 <h3>Cache Statistics for View
<xsl:value-of select=
"@name"/></h3>
552 <table class=
"counters">
553 <xsl:for-each select=
"counters[@type="cachestats"]/counter[.>0]">
554 <xsl:sort select=
"." data-type=
"number" order=
"descending"/>
555 <xsl:variable name=
"css-class5">
557 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
558 <xsl:otherwise>odd
</xsl:otherwise>
561 <tr class=
"{$css-class5}">
563 <xsl:value-of select=
"@name"/>
566 <xsl:value-of select=
"."/>
574 <xsl:for-each select=
"views/view">
575 <xsl:if test=
"cache/rrset">
576 <h3>Cache DB RRsets for View
<xsl:value-of select=
"@name"/></h3>
577 <table class=
"counters">
578 <xsl:for-each select=
"cache/rrset">
579 <xsl:variable name=
"css-class6">
581 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
582 <xsl:otherwise>odd
</xsl:otherwise>
585 <tr class=
"{$css-class6}">
587 <xsl:value-of select=
"name"/>
590 <xsl:value-of select=
"counter"/>
599 <xsl:if test=
"server/counters[@type="sockstat"]/counter[.>0]">
600 <h2>Socket I/O Statistics
</h2>
601 <table class=
"counters">
602 <xsl:for-each select=
"server/counters[@type="sockstat"]/counter[.>0]">
603 <xsl:variable name=
"css-class7">
605 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
606 <xsl:otherwise>odd
</xsl:otherwise>
609 <tr class=
"{$css-class7}">
611 <xsl:value-of select=
"@name"/>
614 <xsl:value-of select=
"."/>
621 <xsl:if test=
"views/view[zones/zone/counters[@type="qtype"]/counter >0]">
622 <h2>Received QTYPES per view/zone
</h2>
623 <xsl:for-each select=
"views/view[zones/zone/counters[@type="qtype"]/counter >0]">
624 <h3>View
<xsl:value-of select=
"@name"/></h3>
625 <xsl:variable name=
"thisview">
626 <xsl:value-of select=
"@name"/>
628 <xsl:for-each select=
"zones/zone">
629 <xsl:if test=
"counters[@type="qtype"]/counter[count(.) > 0]">
630 <h4>Zone
<xsl:value-of select=
"@name"/></h4>
631 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
632 <!-- Non Mozilla specific markup -->
633 <script type=
"text/javascript">
635 'title':
"Query types for zone <xsl:value-of select="@name
"/>",
636 'target': 'chart_qtype_
<xsl:value-of select=
"../../@name"/>_
<xsl:value-of select=
"@name"/>',
638 '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>]
642 <xsl:variable name=
"target">
643 <xsl:value-of select=
"@name"/>
645 <div class=
"pie" id=
"chart_qtype_{$thisview}_{$target}">[no data to display]
</div>
647 <table class=
"counters">
648 <xsl:for-each select=
"counters[@type="qtype"]/counter">
649 <xsl:sort select=
"."/>
650 <xsl:variable name=
"css-class10">
652 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
653 <xsl:otherwise>odd
</xsl:otherwise>
656 <tr class=
"{$css-class10}">
658 <xsl:value-of select=
"@name"/>
661 <xsl:value-of select=
"."/>
670 <xsl:if test=
"views/view[zones/zone/counters[@type="rcode"]/counter >0]">
671 <h2>Response Codes per view/zone
</h2>
672 <xsl:for-each select=
"views/view[zones/zone/counters[@type="rcode"]/counter >0]">
673 <h3>View
<xsl:value-of select=
"@name"/></h3>
674 <xsl:variable name=
"thisview2">
675 <xsl:value-of select=
"@name"/>
677 <xsl:for-each select=
"zones/zone">
678 <xsl:if test=
"counters[@type="rcode"]/counter[. > 0]">
679 <h4>Zone
<xsl:value-of select=
"@name"/></h4>
680 <xsl:if test=
"system-property('xsl:vendor')!='Transformiix'">
681 <!-- Non Mozilla specific markup -->
682 <script type=
"text/javascript">
684 'title':
"Response codes for zone <xsl:value-of select="@name
"/>",
685 'target': 'chart_rescode_
<xsl:value-of select=
"../../@name"/>_
<xsl:value-of select=
"@name"/>',
687 '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>]
691 <xsl:variable name=
"target">
692 <xsl:value-of select=
"@name"/>
694 <div class=
"pie" id=
"chart_rescode_{$thisview2}_{$target}">[no data to display]
</div>
696 <table class=
"counters">
697 <xsl:for-each select=
"counters[@type="rcode"]/counter[.>0 and @name != "QryAuthAns"]">
698 <xsl:sort select=
"."/>
699 <xsl:variable name=
"css-class11">
701 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
702 <xsl:otherwise>odd
</xsl:otherwise>
705 <tr class=
"{$css-class11}">
707 <xsl:value-of select=
"@name"/>
710 <xsl:value-of select=
"."/>
719 <xsl:if test=
"socketmgr/sockets/socket">
720 <h2>Network Status
</h2>
721 <table class=
"netstat">
727 <th>LocalAddress
</th>
731 <xsl:for-each select=
"socketmgr/sockets/socket">
732 <xsl:sort select=
"id"/>
733 <xsl:variable name=
"css-class12">
735 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
736 <xsl:otherwise>odd
</xsl:otherwise>
739 <tr class=
"{$css-class12}">
741 <xsl:value-of select=
"id"/>
744 <xsl:value-of select=
"name"/>
747 <xsl:value-of select=
"type"/>
750 <xsl:value-of select=
"references"/>
753 <xsl:value-of select=
"local-address"/>
756 <xsl:value-of select=
"peer-address"/>
759 <xsl:for-each select=
"states">
760 <xsl:value-of select=
"."/>
768 <xsl:if test=
"taskmgr/thread-model/type">
769 <h2>Task Manager Configuration
</h2>
770 <table class=
"counters">
772 <th class=
"even">Thread-Model
</th>
774 <xsl:value-of select=
"taskmgr/thread-model/type"/>
778 <th>Worker Threads
</th>
780 <xsl:value-of select=
"taskmgr/thread-model/worker-threads"/>
784 <th>Default Quantum
</th>
786 <xsl:value-of select=
"taskmgr/thread-model/default-quantum"/>
790 <th>Tasks Running
</th>
792 <xsl:value-of select=
"taskmgr/thread-model/tasks-running"/>
798 <xsl:value-of select=
"taskmgr/thread-model/tasks-ready"/>
804 <xsl:if test=
"taskmgr/tasks/task">
806 <table class=
"tasks">
815 <xsl:for-each select=
"taskmgr/tasks/task">
816 <xsl:sort select=
"name"/>
817 <xsl:variable name=
"css-class14">
819 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
820 <xsl:otherwise>odd
</xsl:otherwise>
823 <tr class=
"{$css-class14}">
825 <xsl:value-of select=
"id"/>
828 <xsl:value-of select=
"name"/>
831 <xsl:value-of select=
"references"/>
834 <xsl:value-of select=
"state"/>
837 <xsl:value-of select=
"quantum"/>
840 <xsl:value-of select=
"events"/>
847 <xsl:if test=
"memory/summary">
848 <h2>Memory Usage Summary
</h2>
849 <table class=
"counters">
850 <xsl:for-each select=
"memory/summary/*">
851 <xsl:variable name=
"css-class13">
853 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
854 <xsl:otherwise>odd
</xsl:otherwise>
857 <tr class=
"{$css-class13}">
859 <xsl:value-of select=
"name()"/>
862 <xsl:value-of select=
"."/>
869 <xsl:if test=
"memory/contexts/context">
870 <h2>Memory Contexts
</h2>
884 <xsl:for-each select=
"memory/contexts/context">
885 <xsl:sort select=
"total" data-type=
"number" order=
"descending"/>
886 <xsl:variable name=
"css-class14">
888 <xsl:when test=
"position() mod 2 = 0">even
</xsl:when>
889 <xsl:otherwise>odd
</xsl:otherwise>
892 <tr class=
"{$css-class14}">
894 <xsl:value-of select=
"id"/>
897 <xsl:value-of select=
"name"/>
900 <xsl:value-of select=
"references"/>
903 <xsl:value-of select=
"total"/>
906 <xsl:value-of select=
"inuse"/>
909 <xsl:value-of select=
"maxinuse"/>
912 <xsl:value-of select=
"blocksize"/>
915 <xsl:value-of select=
"pools"/>
918 <xsl:value-of select=
"hiwater"/>
921 <xsl:value-of select=
"lowater"/>
928 <p class=
"footer">Internet Systems Consortium Inc.
<br/><a href=
"http://www.isc.org">http://www.isc.org
</a></p>