snmpd.conf 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {%- import "globals.sls" as globals with context %}
  2. {%- set ro_community = salt['pillar.get'] ('ffho:snmp:ro_community', "Configure ffho:snmp:ro_community in pillar...") %}
  3. #
  4. # /etc/snmp/snmpd.conf (Salt managed)
  5. #
  6. # Listen for connections from the local system
  7. agentAddress udp:127.0.0.1:161
  8. agentAddress udp6:[::1]:161
  9. # Listen for connections on Loopback-IPs
  10. {%- if globals.LOOPBACK_IPv4 %}
  11. agentAddress udp:{{ globals.LOOPBACK_IPv4 }}:161
  12. {%- endif %}
  13. {%- if globals.LOOPBACK_IPv6 %}
  14. agentAddress udp6:[{{ globals.LOOPBACK_IPv6 }}]:161
  15. {%- endif %}
  16. ocommunity {{ ro_community }} 10.132.251.161
  17. rocommunity6 {{ ro_community }} fdca:ffee:ff12:a251::161
  18. sysLocation {{ globals.SYS_LOCATION }}
  19. sysContact ops@ffho.net
  20. sysServices 72
  21. #
  22. # Network interfaces
  23. #
  24. {%- if 'gateway' in globals.ROLES %}
  25. # Set B.A.T.M.A.N. related devices to 100 MBit/s
  26. interface bat0 6 100000000
  27. interface inter-gw-vpn 6 100000000
  28. interface mesh-vpn-v4 6 100000000
  29. interface mesh-vpn-v6 6 100000000
  30. {%- endif %}
  31. {%- set ovpn_networks = [] %}
  32. {%- for netname, network in salt['pillar.get']('ovpn', {}).items () if grains['id'] in network %}
  33. {%- do ovpn_networks.append (netname) %}
  34. {%- endfor %}
  35. {%- for netname in ovpn_networks|sort %}
  36. {%- set network = salt['pillar.get']('ovpn:' ~ netname) %}
  37. {%- set network_config = network.get ('config') %}
  38. {%- set host_stanza = network.get (grains['id']) %}
  39. {%- set host_config = host_stanza.get ('config', {}) %}
  40. {%- set interface = host_config.get ('interface', network_config.get ('interface')) %}
  41. {%- if loop.first %}
  42. # OpenVPN interfaces
  43. {%- endif %}
  44. interface {{ interface }} 6 100000000
  45. {%- endfor %}
  46. #
  47. # Try to figure out meaningful interface descriptions/aliases
  48. pass .1.3.6.1.2.1.31.1.1.1.18 /etc/snmp/ifAlias
  49. #
  50. # Disk Monitoring
  51. #
  52. # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
  53. disk / 10000
  54. disk /var 5%
  55. includeAllDisks 10%
  56. # Walk the UCD-SNMP-MIB::dskTable to see the resulting output
  57. # Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
  58. #
  59. # System Load
  60. #
  61. # Unacceptable 1-, 5-, and 15-minute load averages
  62. load 12 10 5
  63. # Walk the UCD-SNMP-MIB::laTable to see the resulting output
  64. # Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
  65. #
  66. # Event MIB - automatically generate alerts
  67. #
  68. # Remember to activate the 'createUser' lines above
  69. iquerySecName internalUser
  70. rouser internalUser
  71. # generate traps on UCD error conditions
  72. defaultMonitors no
  73. # generate traps on linkUp/Down
  74. linkUpDownNotifications no
  75. master agentx