1 <?xml version="1.0" encoding="UTF-8"?>
3 - Copyright (C) 2012, 2013 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.0"]">
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,data) {
37 var data = google.visualization.arrayToDataTable(data);
43 var chart = new google.visualization.BarChart(document.getElementById(target));
44 chart.draw(data, options);
47 function loadGraphs(){
48 //alert("here we are!");
51 // Server Incoming query Types
52 while(g = graphs.shift()){
53 // alert("going for: " + g.target);
54 if(g.data.length > 1){
55 drawChart(g.title,g.target,g.data);
60 // Server Incoming Queries Types
62 'title' : "Server Incoming Query Types",
63 'target': 'chart_incoming_qtypes',
64 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type="qtype"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
68 // Server Incoming Requests
70 'title' : "Server Incoming Requests",
71 'target': 'chart_incoming_requests',
72 'data': [['Requests','Counter'],<xsl:for-each select="server/counters[@type="opcode"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]});
79 <style type="text/css">
81 font-family: sans-serif;
82 background-color: #ffffff;
88 background-color: #f0f0f0;
92 background-color: #ffffff;
101 border-collapse: collapse;
102 border: 1px solid grey;
106 border: 1px solid grey;
112 border: 1px solid grey;
120 table.counters tr:hover{
121 background-color: #99ddff;
125 background-color: rgb(1,169,206);
132 border: 1px solid grey;
136 color: rgb(1,169,206);
141 background-color: #ffffff;
172 color: rgb(1,169,206);
185 <title>ISC BIND 9 Statistics</title>
189 <h1>ISC Bind 9 Configuration and Statistics</h1>
192 <h2>Server Times</h2>
193 <table class="counters">
197 <xsl:value-of select="server/boot-time"/>
201 <th>Sample time:</th>
203 <xsl:value-of select="server/current-time"/>
208 <h2>Incoming Requests</h2>
209 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
210 <!-- Non Mozilla specific markup -->
211 <div class="pie" id="chart_incoming_requests">[no incoming requests]</div>
213 <table class="counters">
214 <xsl:for-each select="server/counters[@type="opcode"]/counter">
215 <xsl:sort select="." data-type="number" order="descending"/>
218 <xsl:value-of select="@name"/>
221 <xsl:value-of select="."/>
226 <th class="totals">Total:</th>
228 <xsl:value-of select="sum(server/counters[@type="opcode"]/counter)"/>
233 <h3>Incoming Queries by Type</h3>
234 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
235 <!-- Non Mozilla specific markup -->
236 <div class="pie" id="chart_incoming_qtypes">[no incoming queries]</div>
238 <table class="counters">
239 <xsl:for-each select="server/counters[@type="qtype"]/counter">
240 <xsl:sort select="." data-type="number" order="descending"/>
241 <xsl:variable name="css-class">
243 <xsl:when test="position() mod 2 = 0">even</xsl:when>
244 <xsl:otherwise>odd</xsl:otherwise>
247 <tr class="{$css-class}">
249 <xsl:value-of select="@name"/>
252 <xsl:value-of select="."/>
257 <th class="totals">Total:</th>
259 <xsl:value-of select="sum(server/counters[@type="qtype"]/counter)"/>
264 <h2>Outgoing Queries per view</h2>
265 <xsl:for-each select="views/view[count(counters[@type="resqtype"]/counter) > 0]">
266 <h3>View <xsl:value-of select="@name"/></h3>
267 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
268 <!-- Non Mozilla specific markup -->
269 <script type="text/javascript">
271 'title': "Outgoing queries for view: <xsl:value-of select="@name"/>",
272 'target': 'chart_outgoing_queries_view_<xsl:value-of select="@name"/>',
273 'data': [['Type','Counter'],<xsl:for-each select="counters[@type="resqtype"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
277 <xsl:variable name="target">
278 <xsl:value-of select="@name"/>
280 <div class="pie" id="chart_outgoing_queries_view_{$target}"/>
282 <table class="counters">
283 <xsl:for-each select="counters[@type="resqtype"]/counter">
284 <xsl:sort select="." data-type="number" order="descending"/>
285 <xsl:variable name="css-class1">
287 <xsl:when test="position() mod 2 = 0">even</xsl:when>
288 <xsl:otherwise>odd</xsl:otherwise>
291 <tr class="{$css-class1}">
293 <xsl:value-of select="@name"/>
296 <xsl:value-of select="."/>
303 <h2>Server Statistics</h2>
304 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
305 <!-- Non Mozilla specific markup -->
306 <script type="text/javascript">
308 'title' : "Server Counters",
309 'target': 'chart_server_nsstat_restype',
310 '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>]
314 <div class="pie" id="chart_server_nsstat_restype"/>
316 <table class="counters">
317 <xsl:for-each select="server/counters[@type="nsstat"]/counter[.>0]">
318 <xsl:sort select="." data-type="number" order="descending"/>
319 <xsl:variable name="css-class2">
321 <xsl:when test="position() mod 2 = 0">even</xsl:when>
322 <xsl:otherwise>odd</xsl:otherwise>
325 <tr class="{$css-class2}">
327 <xsl:value-of select="@name"/>
330 <xsl:value-of select="."/>
336 <h2>Zone Maintenance Statistics</h2>
337 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
338 <script type="text/javascript">
340 'title' : "Zone Maintenance Stats",
341 'target': 'chart_server_zone_maint',
342 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type="zonestat"]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
346 <!-- Non Mozilla specific markup -->
347 <div class="pie" id="chart_server_zone_maint"/>
349 <table class="counters">
350 <xsl:for-each select="server/counters[@type="zonestat"]/counter">
351 <xsl:sort select="." data-type="number" order="descending"/>
352 <xsl:variable name="css-class3">
354 <xsl:when test="position() mod 2 = 0">even</xsl:when>
355 <xsl:otherwise>odd</xsl:otherwise>
358 <tr class="{$css-class3}">
360 <xsl:value-of select="@name"/>
363 <xsl:value-of select="."/>
368 <h2>Resolver Statistics (Common)</h2>
369 <table class="counters">
370 <xsl:for-each select="server/counters[@type="restat"]/counter">
371 <xsl:sort select="." data-type="number" order="descending"/>
372 <xsl:variable name="css-class4">
374 <xsl:when test="position() mod 2 = 0">even</xsl:when>
375 <xsl:otherwise>odd</xsl:otherwise>
378 <tr class="{$css-class4}">
380 <xsl:value-of select="@name"/>
383 <xsl:value-of select="."/>
388 <xsl:for-each select="views/view">
389 <h3>Resolver Statistics for View <xsl:value-of select="@name"/></h3>
390 <table class="counters">
391 <xsl:for-each select="counters[@type="resstats"]/counter[.>0]">
392 <xsl:sort select="." data-type="number" order="descending"/>
393 <xsl:variable name="css-class5">
395 <xsl:when test="position() mod 2 = 0">even</xsl:when>
396 <xsl:otherwise>odd</xsl:otherwise>
399 <tr class="{$css-class5}">
401 <xsl:value-of select="@name"/>
404 <xsl:value-of select="."/>
410 <h3>Cache DB RRsets for View <xsl:value-of select="@name"/></h3>
411 <xsl:for-each select="views/view">
412 <table class="counters">
413 <xsl:for-each select="cache/rrset">
414 <xsl:variable name="css-class6">
416 <xsl:when test="position() mod 2 = 0">even</xsl:when>
417 <xsl:otherwise>odd</xsl:otherwise>
420 <tr class="{$css-class6}">
422 <xsl:value-of select="name"/>
425 <xsl:value-of select="counter"/>
432 <h2>Socket I/O Statistics</h2>
433 <table class="counters">
434 <xsl:for-each select="server/counters[@type="sockstat"]/counter[.>0]">
435 <xsl:variable name="css-class7">
437 <xsl:when test="position() mod 2 = 0">even</xsl:when>
438 <xsl:otherwise>odd</xsl:otherwise>
441 <tr class="{$css-class7}">
443 <xsl:value-of select="@name"/>
446 <xsl:value-of select="."/>
453 <h2>Response Codes per view/zone</h2>
454 <xsl:for-each select="views/view[zones/zone/counters[@type="rcode"]/counter >0]">
455 <h3>View <xsl:value-of select="@name"/></h3>
456 <xsl:variable name="thisview">
457 <xsl:value-of select="@name"/>
459 <xsl:for-each select="zones/zone">
460 <xsl:if test="counters[@type="rcode"]/counter[. > 0]">
461 <h4>Zone <xsl:value-of select="@name"/></h4>
462 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
463 <!-- Non Mozilla specific markup -->
464 <script type="text/javascript">
466 'title': "Response Codes for zone <xsl:value-of select="@name"/>",
467 'target': 'chart_rescode_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
468 '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>]
472 <xsl:variable name="target">
473 <xsl:value-of select="@name"/>
475 <div class="pie" id="chart_rescode_{$thisview}_{$target}"/>
477 <table class="counters">
478 <xsl:for-each select="counters[@type="rcode"]/counter[.>0 and @name != "QryAuthAns"]">
479 <xsl:sort select="."/>
480 <xsl:variable name="css-class10">
482 <xsl:when test="position() mod 2 = 0">even</xsl:when>
483 <xsl:otherwise>odd</xsl:otherwise>
486 <tr class="{$css-class10}">
488 <xsl:value-of select="@name"/>
491 <xsl:value-of select="."/>
499 <h2>Received QTYPES per view/zone</h2>
500 <xsl:for-each select="views/view[zones/zone/counters[@type="qtype"]/counter >0]">
501 <h3>View <xsl:value-of select="@name"/></h3>
502 <xsl:variable name="thisview2">
503 <xsl:value-of select="@name"/>
505 <xsl:for-each select="zones/zone">
506 <xsl:if test="counters[@type="qtype"]/counter[count(.) > 0]">
507 <h4>Zone <xsl:value-of select="@name"/></h4>
508 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
509 <!-- Non Mozilla specific markup -->
510 <script type="text/javascript">
512 'title': "Query Types for zone <xsl:value-of select="@name"/>",
513 'target': 'chart_qtype_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
514 '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>]
518 <xsl:variable name="target">
519 <xsl:value-of select="@name"/>
521 <div class="pie" id="chart_qtype_{$thisview2}_{$target}"/>
523 <table class="counters">
524 <xsl:for-each select="counters[@type="qtype"]/counter">
525 <xsl:sort select="."/>
526 <xsl:variable name="css-class11">
528 <xsl:when test="position() mod 2 = 0">even</xsl:when>
529 <xsl:otherwise>odd</xsl:otherwise>
532 <tr class="{$css-class11}">
534 <xsl:value-of select="@name"/>
537 <xsl:value-of select="."/>
545 <h2>Network Status</h2>
546 <table class="counters">
552 <th>LocalAddress</th>
556 <xsl:for-each select="socketmgr/sockets/socket">
557 <xsl:sort select="id"/>
558 <xsl:variable name="css-class12">
560 <xsl:when test="position() mod 2 = 0">even</xsl:when>
561 <xsl:otherwise>odd</xsl:otherwise>
564 <tr class="{$css-class12}">
566 <xsl:value-of select="id"/>
569 <xsl:value-of select="name"/>
572 <xsl:value-of select="type"/>
575 <xsl:value-of select="references"/>
578 <xsl:value-of select="local-address"/>
581 <xsl:value-of select="peer-address"/>
584 <xsl:for-each select="states">
585 <xsl:value-of select="."/>
592 <h2>Task Manager Configuration</h2>
593 <table class="counters">
595 <th class="even">Thread-Model</th>
597 <xsl:value-of select="taskmgr/thread-model/type"/>
601 <th>Worker Threads</th>
603 <xsl:value-of select="taskmgr/thread-model/worker-threads"/>
607 <th>Default Quantum</th>
609 <xsl:value-of select="taskmgr/thread-model/default-quantum"/>
613 <th>Tasks Running</th>
615 <xsl:value-of select="taskmgr/thread-model/tasks-running"/>
621 <table class="counters">
629 <xsl:for-each select="taskmgr/tasks/task">
630 <xsl:sort select="name"/>
631 <xsl:variable name="css-class14">
633 <xsl:when test="position() mod 2 = 0">even</xsl:when>
634 <xsl:otherwise>odd</xsl:otherwise>
637 <tr class="{$css-class14}">
639 <xsl:value-of select="id"/>
642 <xsl:value-of select="name"/>
645 <xsl:value-of select="references"/>
648 <xsl:value-of select="state"/>
651 <xsl:value-of select="quantum"/>
657 <h2>Memory Usage Summary</h2>
658 <table class="counters">
659 <xsl:for-each select="memory/summary/*">
660 <xsl:variable name="css-class13">
662 <xsl:when test="position() mod 2 = 0">even</xsl:when>
663 <xsl:otherwise>odd</xsl:otherwise>
666 <tr class="{$css-class13}">
668 <xsl:value-of select="name()"/>
671 <xsl:value-of select="."/>
677 <h2>Memory Contexts</h2>
678 <table class="counters">
691 <xsl:for-each select="memory/contexts/context">
692 <xsl:sort select="total" data-type="number" order="descending"/>
693 <xsl:variable name="css-class14">
695 <xsl:when test="position() mod 2 = 0">even</xsl:when>
696 <xsl:otherwise>odd</xsl:otherwise>
699 <tr class="{$css-class14}">
701 <xsl:value-of select="id"/>
704 <xsl:value-of select="name"/>
707 <xsl:value-of select="references"/>
710 <xsl:value-of select="total"/>
713 <xsl:value-of select="inuse"/>
716 <xsl:value-of select="maxinuse"/>
719 <xsl:value-of select="blocksize"/>
722 <xsl:value-of select="pools"/>
725 <xsl:value-of select="hiwater"/>
728 <xsl:value-of select="lowater"/>
734 <p class="footer">Internet Systems Consortium Inc.<br/><a href="http://www.isc.org">http://www.isc.org</a></p>