[[outputs.influxdb]] urls = ["$INFLUX_URL"] skip_database_creation = false # snmpget -v 3 -u $username -a SHA -A $password -l authPriv -x AES -X $password 192.168.10.21 RFC1213-MIB::sysName.0 {% for device in devices %} # Device: {{ device.name }}, type: {{ device.type }} [[inputs.snmp]] agents = [ "{{ device.ip }}" ] {# Some MIBs are missing over v3 #} {% if true %} version = 2 community = "public" {% else %} version = 3 sec_name = "{{ '{{' }} unifi_snmp_username }}" auth_protocol = "SHA" auth_password = "{{ '{{' }} unifi_snmp_password }}" sec_level = "authPriv" priv_protocol = "AES" priv_password = "{{ '{{' }} unifi_snmp_password }}" interval = "60s" timeout = "30s" {% endif %} [[inputs.snmp.field]] oid = "RFC1213-MIB::sysName.0" name = "name" is_tag = true [[inputs.snmp.field]] oid = "RFC1213-MIB::sysLocation.0" name = "location" is_tag = true [[inputs.snmp.table]] oid = "IF-MIB::ifXTable" name = "snmp_if_iftable" inherit_tags = ["name", "location"] {% if device.type == "ap" %} [[inputs.snmp.table]] oid = "UBNT-UniFi-MIB::unifiRadioTable" name = "unifi_radio" index_as_tag = true inherit_tags = ["name", "location"] [[inputs.snmp.table]] oid = "UBNT-UniFi-MIB::unifiVapTable" name = "unifi_vap" index_as_tag = true inherit_tags = ["name", "location"] {% endif %} # SNMP Fields that should be tags {% for f in [ "ifName", "ifLinkUpDownTrapEnable", "ifHighSpeed", "ifPromiscuousMode", "ifConnectorPresent", "ifAlias", "ifCounterDiscontinuityTime" ] %} [[inputs.snmp.table.field]] oid = "IF-MIB::{{ f }}" is_tag = true {% endfor %} {% for f in [ "unifiRadioName", "unifiRadioRadio", "unifiRadioOtherBss" ] %} [[inputs.snmp.table.field]] oid = "UBNT-UniFi-MIB::{{ f }}" is_tag = true {% endfor %} {% for f in [ "unifiVapBssId", "unifiVapCcq", "unifiVapEssId", "unifiVapName", "unifiVapRadio", "unifiVapUp", "unifiVapUsage" ] %} [[inputs.snmp.table.field]] oid = "UBNT-UniFi-MIB::{{ f }}" is_tag = true {% endfor %} {% endfor %}