snmpd.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --[[
  2. LuCI model for net-snmp configuration management
  3. Copyright Karl Palsson <karlp@etactica.com>
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. ]]--
  9. local datatypes = require("luci.cbi.datatypes")
  10. m = Map("snmpd", "net-snmp's SNMPD",
  11. [[SNMPD is a master daemon/agent for SNMP, from the <a href='http://www.net-snmp.org'>
  12. net-snmp project</a>.
  13. Note, OpenWrt has mostly complete UCI support for snmpd, but this LuCI applet
  14. only covers a few of those options. In particular, there is very little/no validation
  15. or help.
  16. See /etc/config/snmpd for manual configuration.
  17. ]])
  18. s = m:section(TypedSection, "agent", "Agent settings")
  19. s.anonymous = true
  20. p = s:option(Value, "agentaddress", "The address the agent should listen on",
  21. [[Eg: UDP:161, or UDP:10.5.4.3:161 to only listen on a given interface]])
  22. s = m:section(TypedSection, "agentx", "AgentX settings", "Delete this section to disable agentx")
  23. s.anonymous = true
  24. p = s:option(Value, "agentxsocket", "The address the agent should allow agentX connections to",
  25. [[This is only necessary if you have subagents using the agentX socket protocol.
  26. Eg: /var/run/agentx.sock]])
  27. s.addremove=true
  28. s = m:section(TypedSection, "com2sec", "com2sec security")
  29. p = s:option(Value, "secname", "secname")
  30. p = s:option(Value, "source", "source")
  31. p = s:option(Value, "community", "community")
  32. s = m:section(TypedSection, "group", "group", "Groups help define access methods")
  33. s.addremove=true
  34. s:option(Value, "group", "group")
  35. s:option(Value, "version", "version")
  36. s:option(Value, "secname", "secname")
  37. s = m:section(TypedSection, "access", "access")
  38. s:option(Value, "group", "group")
  39. s:option(Value, "context", "context")
  40. s:option(Value, "version", "version")
  41. s:option(Value, "level", "level")
  42. s:option(Value, "prefix", "prefix")
  43. s:option(Value, "read", "read")
  44. s:option(Value, "write", "write")
  45. s:option(Value, "notify", "notify")
  46. s = m:section(TypedSection, "system", "System", "Values used in the MIB2 System tree")
  47. s.anonymous = true
  48. s:option(Value, "sysLocation", "sysLocation")
  49. s:option(Value, "sysContact", "sysContact")
  50. s:option(Value, "sysName", "sysName")
  51. return m