summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/dns.lua
blob: cf96d8fbe192b36273c71f45abbcb07723e1f8af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
-- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
-- Licensed to the public under the Apache License 2.0.

module("luci.statistics.rrdtool.definitions.dns", package.seeall)

function rrdargs( graph, plugin, plugin_instance )

	local traffic = {
		title = "%H: DNS traffic", vlabel = "Bit/s",

		data = {
			sources = {
				dns_octets = { "queries", "responses" }
			},

			options = {
				dns_octets__responses = {
					total = true,
					color = "00ff00",
					title = "Responses"
				},

				dns_octets__queries = {
					total = true,
					color = "0000ff",
					title = "Queries"
				}
			}
		}
	}

	local opcode_query = {
		title = "%H: DNS Opcode Query", vlabel = "Queries/s",
		data = {
			instances = { dns_opcode = { "Query" } },
			options = {
				dns_opcode_Query_value = {
					total = true,
					color = "0000ff",
					title = "Queries/s"
				},
			}
		}
	}

	local qtype = {
		title = "%H: DNS QType", vlabel = "Queries/s",
		data = {
			sources = { dns_qtype = { "" } },
			options = {
				dns_qtype_AAAA_	= { title = "AAAA", noarea = true, total = true },
				dns_qtype_A_	= { title = "A", noarea = true, total = true },
				dns_qtype_A6_	= { title = "A6", noarea = true, total = true },
				dns_qtype_TXT_	= { title = "TXT", noarea = true, total = true },
				dns_qtype_MX_	= { title = "MX", noarea = true, total = true },
				dns_qtype_NS_	= { title = "NS", noarea = true, total = true },
				dns_qtype_ANY_	= { title = "ANY", noarea = true, total = true },
				dns_qtype_CNAME_= { title = "CNAME", noarea = true, total = true },
				dns_qtype_SOA_	= { title = "SOA", noarea = true, total = true },
				dns_qtype_SRV_	= { title = "SRV", noarea = true, total = true },
				dns_qtype_PTR_	= { title = "PTR", noarea = true, total = true },
				dns_qtype_RP_	= { title = "RP", noarea = true, total = true },
				dns_qtype_MAILB_= { title = "MAILB", noarea = true, total = true },
				dns_qtype_IXFR_	= { title = "IXFR", noarea = true, total = true },
				dns_qtype_HINFO_= { title = "HINFO", noarea = true, total = true },
			},
		}
	}
				
	return { traffic, opcode_query, qtype }
end