Rework LuCI build system
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / dns.lua
1 --[[
2
3 Luci statistics - dns plugin diagram definition
4
5 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12 ]]--
13
14 module("luci.statistics.rrdtool.definitions.dns", package.seeall)
15
16 function rrdargs( graph, plugin, plugin_instance )
17
18 local traffic = {
19 title = "%H: DNS traffic", vlabel = "Bit/s",
20
21 data = {
22 sources = {
23 dns_octets = { "queries", "responses" }
24 },
25
26 options = {
27 dns_octets__responses = {
28 total = true,
29 color = "00ff00",
30 title = "Responses"
31 },
32
33 dns_octets__queries = {
34 total = true,
35 color = "0000ff",
36 title = "Queries"
37 }
38 }
39 }
40 }
41
42 local opcode_query = {
43 title = "%H: DNS Opcode Query", vlabel = "Queries/s",
44 data = {
45 instances = { dns_opcode = { "Query" } },
46 options = {
47 dns_opcode_Query_value = {
48 total = true,
49 color = "0000ff",
50 title = "Queries/s"
51 },
52 }
53 }
54 }
55
56 local qtype = {
57 title = "%H: DNS QType", vlabel = "Queries/s",
58 data = {
59 sources = { dns_qtype = { "" } },
60 options = {
61 dns_qtype_AAAA_ = { title = "AAAA", noarea = true, total = true },
62 dns_qtype_A_ = { title = "A", noarea = true, total = true },
63 dns_qtype_A6_ = { title = "A6", noarea = true, total = true },
64 dns_qtype_TXT_ = { title = "TXT", noarea = true, total = true },
65 dns_qtype_MX_ = { title = "MX", noarea = true, total = true },
66 dns_qtype_NS_ = { title = "NS", noarea = true, total = true },
67 dns_qtype_ANY_ = { title = "ANY", noarea = true, total = true },
68 dns_qtype_CNAME_= { title = "CNAME", noarea = true, total = true },
69 dns_qtype_SOA_ = { title = "SOA", noarea = true, total = true },
70 dns_qtype_SRV_ = { title = "SRV", noarea = true, total = true },
71 dns_qtype_PTR_ = { title = "PTR", noarea = true, total = true },
72 dns_qtype_RP_ = { title = "RP", noarea = true, total = true },
73 dns_qtype_MAILB_= { title = "MAILB", noarea = true, total = true },
74 dns_qtype_IXFR_ = { title = "IXFR", noarea = true, total = true },
75 dns_qtype_HINFO_= { title = "HINFO", noarea = true, total = true },
76 },
77 }
78 }
79
80 return { traffic, opcode_query, qtype }
81 end