Advertisement
Guest User

Untitled

a guest
Feb 18th, 2022
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. module("luci.statistics.rrdtool.definitions.exec", package.seeall)
  2.  
  3. function item()
  4. return luci.i18n.translate("Exec")
  5. end
  6.  
  7. -- function rrdargs(graph, host, plugin, plugin_instance, dtype)
  8. function rrdargs(graph, plugin, plugin_instance, dtype)
  9. -- For $HOSTNAME/exec-foo-bar/temperature_baz-quux.rrd, plugin will be
  10. -- "exec" and plugin_instance will be "foo-bar". I guess graph will be
  11. -- "baz-quux"? We may also be ignoring a fourth argument, dtype.
  12. if "dsldr" == plugin_instance then
  13. return {
  14. title = "%H: DSL-Datarate",
  15. vlabel = "dsldr",
  16. number_format = "%8.0lf",
  17. autoscale_max = true,
  18. data = {
  19. types = { "gauge" },
  20. options = {
  21. gauge_downdr = {
  22. color = "00ff00",
  23. title = "Down DataRate",
  24. overlay = true,
  25. noarea = false,
  26. total = false,
  27. flip = true
  28. },
  29. gauge_updr = {
  30. color = "0000ff",
  31. title = "Up DataRate",
  32. overlay = true,
  33. noarea = false,
  34. total = false,
  35. flip = false
  36. },
  37. gauge_downadr = {
  38. color = "B0FF00",
  39. title = "Down ATTNDR",
  40. overlay = true,
  41. noarea = true,
  42. total = false,
  43. flip = true
  44. },
  45. gauge_upadr = {
  46. color = "FF00FF",
  47. title = "Up ATTNDR",
  48. overlay = true,
  49. noarea = true,
  50. total = false
  51. }
  52. }
  53. }
  54. }
  55. end
  56.  
  57. if "dslsnr" == plugin_instance then
  58. return {
  59. title = "%H: DSL-SNR",
  60. vlabel = "dslsnr",
  61. number_format = "%8.0lf",
  62. autoscale_max = true,
  63. data = {
  64. types = { "gauge" },
  65. sources = { gauge = { "down", "up" } },
  66. options = {
  67. gauge__down = { color = "00ff00", title = "Down SNR", overlay = true, noarea = false, total = false, flip = true },
  68. gauge__up = { color = "0000ff", title = "Up SNR", overlay = true, noarea = false, total = false }
  69. }
  70. }
  71. }
  72. end
  73.  
  74. if "dslerr" == plugin_instance then
  75. return {
  76. title = "%H: DSL-Errors",
  77. vlabel = "dslerr",
  78. number_format = "%8.0lf",
  79. autoscale_max = true,
  80. data = {
  81. types = { "gauge" },
  82. options = {
  83. gauge_loss = { color = "00FF00", title = "LOSS", overlay = true, noarea = true, total = false },
  84. gauge_uas = { color = "0000FF", title = "UAS", overlay = true, noarea = true, total = false },
  85. gauge_f_loss = { color = "FF8000", title = "Far LOSS", overlay = true, noarea = true, total = false, flip = true },
  86. gauge_f_uas = { color = "FF00FF", title = "Far UAS", overlay = true, noarea = true, total = false, flip = true }
  87. }
  88. }
  89. }
  90. end
  91.  
  92. if "dslcrc" == plugin_instance then
  93. return {
  94. title = "%H: DSL-CRC-Errors",
  95. vlabel = "dslcrc",
  96. number_format = "%8.0lf",
  97. autoscale_max = true,
  98. data = {
  99. types = { "gauge" },
  100. options = {
  101. gauge_crc = { color = "00FF00", title = "CRC", overlay = true, noarea = true, total = false },
  102. gauge_crcp = { color = "0000FF", title = "CRC-p", overlay = true, noarea = true, total = false },
  103. gauge_f_crc = { color = "FF8000", title = "Far CRC", overlay = true, noarea = true, total = false, flip = true },
  104. gauge_f_crcp = { color = "FF00FF", title = "Far CRC-p", overlay = true, noarea = true, total = false, flip = true }
  105. }
  106. }
  107. }
  108. end
  109.  
  110. if "dslfec" == plugin_instance then
  111. return {
  112. title = "%H: DSL-FEC-Errors",
  113. vlabel = "dslfec",
  114. number_format = "%8.0lf",
  115. autoscale_max = true,
  116. data = {
  117. types = { "gauge" },
  118. options = {
  119. gauge_fec = { color = "00FF00", title = "FEC", overlay = true, noarea = true, total = false },
  120. gauge_f_fec = { color = "FF8000", title = "Far FEC", overlay = true, noarea = true, total = false, flip = true },
  121. }
  122. }
  123. }
  124. end
  125.  
  126. if "dsles" == plugin_instance then
  127. return {
  128. title = "%H: DSL--Errored-Seconds",
  129. vlabel = "dsles",
  130. number_format = "%8.0lf",
  131. autoscale_max = true,
  132. data = {
  133. types = { "gauge" },
  134. options = {
  135. gauge_es = { color = "00FF00", title = "ES", overlay = true, noarea = true, total = false },
  136. gauge_ses = { color = "0000FF", title = "SES", overlay = true, noarea = true, total = false },
  137. gauge_f_es = { color = "FF8000", title = "Far ES", overlay = true, noarea = true, total = false, flip = true },
  138. gauge_f_ses = { color = "FF00FF", title = "Far SES", overlay = true, noarea = true, total = false, flip = true }
  139. }
  140. }
  141. }
  142. end
  143. end
  144.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement