collectd.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. require("luci.sys")
  4. m = Map("luci_statistics",
  5. translate("Collectd Settings"),
  6. translate(
  7. "Collectd is a small daemon for collecting data from " ..
  8. "various sources through different plugins. On this page " ..
  9. "you can change general settings for the collectd daemon."
  10. ))
  11. -- general config section
  12. s = m:section( NamedSection, "collectd", "luci_statistics" )
  13. -- general.hostname (Hostname)
  14. hostname = s:option( Value, "Hostname", translate("Hostname") )
  15. hostname.default = luci.sys.hostname()
  16. hostname.optional = true
  17. -- general.basedir (BaseDir)
  18. basedir = s:option( Value, "BaseDir", translate("Base Directory") )
  19. basedir.default = "/var/run/collectd"
  20. -- general.include (Include)
  21. include = s:option( Value, "Include", translate("Directory for sub-configurations") )
  22. include.default = "/etc/collectd/conf.d/*.conf"
  23. -- general.plugindir (PluginDir)
  24. plugindir = s:option( Value, "PluginDir", translate("Directory for collectd plugins") )
  25. plugindir.default = "/usr/lib/collectd/"
  26. -- general.pidfile (PIDFile)
  27. pidfile = s:option( Value, "PIDFile", translate("Used PID file") )
  28. pidfile.default = "/var/run/collectd.pid"
  29. -- general.typesdb (TypesDB)
  30. typesdb = s:option( Value, "TypesDB", translate("Datasets definition file") )
  31. typesdb.default = "/etc/collectd/types.db"
  32. -- general.interval (Interval)
  33. interval = s:option( Value, "Interval", translate("Data collection interval"), translate("Seconds") )
  34. interval.default = 60
  35. interval.isnumber = true
  36. -- general.readthreads (ReadThreads)
  37. readthreads = s:option( Value, "ReadThreads", translate("Number of threads for data collection") )
  38. readthreads.default = 5
  39. readthreads.isnumber = true
  40. -- general.fqdnlookup (FQDNLookup)
  41. fqdnlookup = s:option( Flag, "FQDNLookup", translate("Try to lookup fully qualified hostname") )
  42. fqdnlookup.enabled = "true"
  43. fqdnlookup.disabled = "false"
  44. fqdnlookup.default = "false"
  45. fqdnlookup.optional = true
  46. fqdnlookup:depends( "Hostname", "" )
  47. return m