snmpd.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // SPDX: Apache-2.0
  2. // Karl Palsson <karlp@etactica.com> 2021
  3. 'use strict';
  4. 'require form';
  5. 'require ui';
  6. 'require view';
  7. var desc = _(""
  8. + "SNMPD is a master daemon/agent for SNMP, from the <a href='http://www.net-snmp.org'>"
  9. + "net-snmp project</a>. "
  10. + "Note, OpenWrt has mostly complete UCI support for snmpd, but this LuCI applet "
  11. + "only covers a few of those options. In particular, there is very little/no validation "
  12. + "or help. See /etc/config/snmpd for manual configuration."
  13. );
  14. return view.extend({
  15. render: function() {
  16. var m, s, o;
  17. m = new form.Map("snmpd", _("net-snmp's SNMPD"), desc);
  18. s = m.section(form.TypedSection, "agent", _("Agent settings"));
  19. s.anonymous = true;
  20. o = s.option(form.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(form.TypedSection, "agentx", _("AgentX settings"),
  23. _("Delete this section to disable AgentX"));
  24. s.anonymous = true;
  25. o = s.option(form.Value, "agentxsocket", _("The address the agent should allow AgentX connections to"),
  26. _("This is only necessary if you have subagents using the agentX "
  27. + "socket protocol. Eg: /var/run/agentx.sock"));
  28. s.addremove = true;
  29. s = m.section(form.TypedSection, "com2sec", _("com2sec security"));
  30. o = s.option(form.Value, "secname", "secname");
  31. o = s.option(form.Value, "source", "source");
  32. o = s.option(form.Value, "community", "community");
  33. s = m.section(form.TypedSection, "group", "group", _("Groups help define access methods"));
  34. s.addremove = true;
  35. s.option(form.Value, "group", "group");
  36. s.option(form.Value, "version", "version");
  37. s.option(form.Value, "secname", "secname");
  38. s = m.section(form.TypedSection, "access", "access");
  39. s.option(form.Value, "group", "group");
  40. s.option(form.Value, "context", "context");
  41. s.option(form.Value, "version", "version");
  42. s.option(form.Value, "level", "level");
  43. s.option(form.Value, "prefix", "prefix");
  44. s.option(form.Value, "read", "read");
  45. s.option(form.Value, "write", "write");
  46. s.option(form.Value, "notify", "notify");
  47. s = m.section(form.TypedSection, "system", _("System"), _("Values used in the MIB2 System tree"));
  48. s.anonymous = true;
  49. s.option(form.Value, "sysLocation", "sysLocation");
  50. s.option(form.Value, "sysContact", "sysContact");
  51. s.option(form.Value, "sysName", "sysName");
  52. return m.render();
  53. }
  54. });