network.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. m = Map("luci_statistics",
  4. translate("Network Plugin Configuration"),
  5. translate(
  6. "The network plugin provides network based communication between " ..
  7. "different collectd instances. Collectd can operate both in client " ..
  8. "and server mode. In client mode locally collected data is " ..
  9. "transferred to a collectd server instance, in server mode the " ..
  10. "local instance receives data from other hosts."
  11. ))
  12. -- collectd_network config section
  13. s = m:section( NamedSection, "collectd_network", "luci_statistics" )
  14. -- collectd_network.enable
  15. enable = s:option( Flag, "enable", translate("Enable this plugin") )
  16. enable.default = 0
  17. -- collectd_network_listen config section (Listen)
  18. listen = m:section( TypedSection, "collectd_network_listen",
  19. translate("Listener interfaces"),
  20. translate(
  21. "This section defines on which interfaces collectd will wait " ..
  22. "for incoming connections."
  23. ))
  24. listen.addremove = true
  25. listen.anonymous = true
  26. -- collectd_network_listen.host
  27. listen_host = listen:option( Value, "host", translate("Listen host") )
  28. listen_host.default = "0.0.0.0"
  29. -- collectd_network_listen.port
  30. listen_port = listen:option( Value, "port", translate("Listen port") )
  31. listen_port.default = 25826
  32. listen_port.isinteger = true
  33. listen_port.optional = true
  34. -- collectd_network_server config section (Server)
  35. server = m:section( TypedSection, "collectd_network_server",
  36. translate("server interfaces"),
  37. translate(
  38. "This section defines to which servers the locally collected " ..
  39. "data is sent to."
  40. ))
  41. server.addremove = true
  42. server.anonymous = true
  43. -- collectd_network_server.host
  44. server_host = server:option( Value, "host", translate("Server host") )
  45. server_host.default = "0.0.0.0"
  46. -- collectd_network_server.port
  47. server_port = server:option( Value, "port", translate("Server port") )
  48. server_port.default = 25826
  49. server_port.isinteger = true
  50. server_port.optional = true
  51. -- collectd_network.timetolive (TimeToLive)
  52. ttl = s:option( Value, "TimeToLive", translate("TTL for network packets") )
  53. ttl.default = 128
  54. ttl.isinteger = true
  55. ttl.optional = true
  56. ttl:depends( "enable", 1 )
  57. -- collectd_network.forward (Forward)
  58. forward = s:option( Flag, "Forward", translate("Forwarding between listen and server addresses") )
  59. forward.default = 0
  60. forward.optional = true
  61. forward:depends( "enable", 1 )
  62. -- collectd_network.cacheflush (CacheFlush)
  63. cacheflush = s:option( Value, "CacheFlush",
  64. translate("Cache flush interval"), translate("Seconds") )
  65. cacheflush.default = 86400
  66. cacheflush.isinteger = true
  67. cacheflush.optional = true
  68. cacheflush:depends( "enable", 1 )
  69. return m