Merge pull request #1818 from dibdot/lxc_fix
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / dns.lua
1 -- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
2 -- Licensed to the public under the Apache License 2.0.
3
4 module("luci.statistics.rrdtool.definitions.dns", package.seeall)
5
6 function rrdargs( graph, plugin, plugin_instance )
7
8         local traffic = {
9                 title = "%H: DNS traffic", vlabel = "Bit/s",
10
11                 data = {
12                         sources = {
13                                 dns_octets = { "queries", "responses" }
14                         },
15
16                         options = {
17                                 dns_octets__responses = {
18                                         total = true,
19                                         color = "00ff00",
20                                         title = "Responses"
21                                 },
22
23                                 dns_octets__queries = {
24                                         total = true,
25                                         color = "0000ff",
26                                         title = "Queries"
27                                 }
28                         }
29                 }
30         }
31
32         local opcode_query = {
33                 title = "%H: DNS Opcode Query", vlabel = "Queries/s",
34                 data = {
35                         instances = { dns_opcode = { "Query" } },
36                         options = {
37                                 dns_opcode_Query_value = {
38                                         total = true,
39                                         color = "0000ff",
40                                         title = "Queries/s"
41                                 },
42                         }
43                 }
44         }
45
46         local qtype = {
47                 title = "%H: DNS QType", vlabel = "Queries/s",
48                 data = {
49                         sources = { dns_qtype = { "" } },
50                         options = {
51                                 dns_qtype_AAAA_ = { title = "AAAA", noarea = true, total = true },
52                                 dns_qtype_A_    = { title = "A", noarea = true, total = true },
53                                 dns_qtype_A6_   = { title = "A6", noarea = true, total = true },
54                                 dns_qtype_TXT_  = { title = "TXT", noarea = true, total = true },
55                                 dns_qtype_MX_   = { title = "MX", noarea = true, total = true },
56                                 dns_qtype_NS_   = { title = "NS", noarea = true, total = true },
57                                 dns_qtype_ANY_  = { title = "ANY", noarea = true, total = true },
58                                 dns_qtype_CNAME_= { title = "CNAME", noarea = true, total = true },
59                                 dns_qtype_SOA_  = { title = "SOA", noarea = true, total = true },
60                                 dns_qtype_SRV_  = { title = "SRV", noarea = true, total = true },
61                                 dns_qtype_PTR_  = { title = "PTR", noarea = true, total = true },
62                                 dns_qtype_RP_   = { title = "RP", noarea = true, total = true },
63                                 dns_qtype_MAILB_= { title = "MAILB", noarea = true, total = true },
64                                 dns_qtype_IXFR_ = { title = "IXFR", noarea = true, total = true },
65                                 dns_qtype_HINFO_= { title = "HINFO", noarea = true, total = true },
66                         },
67                 }
68         }
69                                 
70         return { traffic, opcode_query, qtype }
71 end