123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- {%- import "globals.sls" as globals with context %}
- {%- set ro_community = salt['pillar.get'] ('ffho:snmp:ro_community', "Configure ffho:snmp:ro_community in pillar...") %}
- #
- # /etc/snmp/snmpd.conf (Salt managed)
- #
- # Listen for connections from the local system
- agentAddress udp:127.0.0.1:161
- agentAddress udp6:[::1]:161
- # Listen for connections on Loopback-IPs
- {%- for ipv4 in grains['ipv4'] %}
- {%- if ipv4.startswith ('10.132.255.') %}
- agentAddress udp:{{ ipv4 }}:161
- {%- endif %}
- {%- endfor %}
- {%- for ipv6 in grains['ipv6'] %}
- {%- if ipv6.startswith ('2a03:2260:2342:ffff:') or ipv6.startswith ('fdca:ffee:ff12:ffff:') %}
- agentAddress udp6:[{{ ipv6 }}]:161
- {%- endif %}
- {%- endfor %}
- rocommunity {{ ro_community }} 127.0.0.1
- rocommunity {{ ro_community }} 10.132.251.161
- rocommunity6 {{ ro_community }} ::1
- rocommunity6 {{ ro_community }} fdca:ffee:ff12:a251::161
- sysLocation {{ globals.SYS_LOCATION }}
- sysContact ops@ffho.net
- sysServices 72
- #
- # Network interfaces
- #
- {%- if 'gateway' in globals.ROLES %}
- # Set B.A.T.M.A.N. related devices to 100 MBit/s
- interface bat0 6 100000000
- interface inter-gw-vpn 6 100000000
- interface mesh-vpn-v4 6 100000000
- interface mesh-vpn-v6 6 100000000
- {%- endif %}
- {%- set ovpn_networks = [] %}
- {%- for netname, network in salt['pillar.get']('ovpn', {}).items () if grains['id'] in network %}
- {%- do ovpn_networks.append (netname) %}
- {%- endfor %}
- {%- for netname in ovpn_networks|sort %}
- {%- set network = salt['pillar.get']('ovpn:' ~ netname) %}
- {%- set network_config = network.get ('config') %}
- {%- set host_stanza = network.get (grains['id']) %}
- {%- set host_config = host_stanza.get ('config', {}) %}
- {%- set interface = host_config.get ('interface', network_config.get ('interface')) %}
- {%- if loop.first %}
- # OpenVPN interfaces
- {%- endif %}
- interface {{ interface }} 6 100000000
- {%- endfor %}
- #
- # Try to figure out meaningful interface descriptions/aliases
- pass .1.3.6.1.2.1.31.1.1.1.18 /etc/snmp/ifAlias
- #
- # Disk Monitoring
- #
- # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
- disk / 10000
- disk /var 5%
- includeAllDisks 10%
- # Walk the UCD-SNMP-MIB::dskTable to see the resulting output
- # Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
- #
- # System Load
- #
- # Unacceptable 1-, 5-, and 15-minute load averages
- load 12 10 5
- # Walk the UCD-SNMP-MIB::laTable to see the resulting output
- # Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
- #
- # Event MIB - automatically generate alerts
- #
- # Remember to activate the 'createUser' lines above
- iquerySecName internalUser
- rouser internalUser
- # generate traps on UCD error conditions
- defaultMonitors no
- # generate traps on linkUp/Down
- linkUpDownNotifications no
- master agentx
|