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