dns.lua 2.1 KB

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