summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/luasrc
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-11-28 14:56:57 +0000
committerManuel Munz <freifunk@somakoma.de>2011-11-28 14:56:57 +0000
commit8bea1337a9dbae7a7cac0da88c5e1bfc27f74f4c (patch)
tree6204565f21239510908034afe7a2b682e0efe693 /applications/luci-statistics/luasrc
parentf09ffc2850d43672d036f3e710a9880444fcd678 (diff)
applications/luci-statistics: Add dns graph-model
Diffstat (limited to 'applications/luci-statistics/luasrc')
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/dns.lua81
1 files changed, 81 insertions, 0 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/dns.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/dns.lua
new file mode 100644
index 000000000..4f328c3c0
--- /dev/null
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/dns.lua
@@ -0,0 +1,81 @@
+--[[
+
+Luci statistics - dns plugin diagram definition
+
+Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+module("luci.statistics.rrdtool.definitions.dns", package.seeall)
+
+function rrdargs( graph, host, 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