From 115a89cc823e56eb0c2074dc36351606f2346292 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 1 Oct 2020 08:02:59 +0200 Subject: unifi: Telegraf configuration. --- ansible/plays/templates/ops-server/telegraf.conf | 238 +++++++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 ansible/plays/templates/ops-server/telegraf.conf (limited to 'ansible/plays/templates/ops-server/telegraf.conf') diff --git a/ansible/plays/templates/ops-server/telegraf.conf b/ansible/plays/templates/ops-server/telegraf.conf new file mode 100644 index 0000000..18a858b --- /dev/null +++ b/ansible/plays/templates/ops-server/telegraf.conf @@ -0,0 +1,238 @@ +[[outputs.influxdb]] + urls = ["$INFLUX_URL"] + skip_database_creation = false + +# Access point: Over stue + +[[inputs.snmp]] + agents = [ "192.168.10.20" ] + version = 2 + community = "public" + interval = "60s" + timeout = "30s" + +# meta information +# this will be added automatically as a tag to the next snmp.table +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysName.0" + name = "ap_name" + is_tag = true + +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysLocation.0" + name = "ap_location" + is_tag = true + +# table +[[inputs.snmp.table]] +# Using the oid here will query all fields automatically! +# Be careful when using the oid on inputs.snmp.table as this will +# produce a lot of information +# oid = "IF-MIB::ifXTable" + name = "unifi_ap_if" + inherit_tags = ["ap_name", "ap_location"] + +# fields +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifName" + name = "name" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifOperStatus" + name = "status" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifAlias" + name = "ifAlias" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPromiscuousMode" + name = "promiscuous_mode" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifConnectorPresent" + name = "has_connector" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPhysAddress" + name = "mac" + conversion = "hwaddr" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInOctets" + name = "rx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInUcastPkts" + name = "rx_ucast_pkt" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutOctets" + name = "tx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutUcastPkts" + name = "tx_ucast_pkt" + +# Access point: Over kjøkken + +[[inputs.snmp]] + agents = [ "192.168.10.21" ] + version = 2 + community = "public" + interval = "60s" + timeout = "30s" + +# meta information +# this will be added automatically as a tag to the next snmp.table +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysName.0" + name = "ap_name" + is_tag = true + +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysLocation.0" + name = "ap_location" + is_tag = true + +# table +[[inputs.snmp.table]] +# Using the oid here will query all fields automatically! +# Be careful when using the oid on inputs.snmp.table as this will +# produce a lot of information +# oid = "IF-MIB::ifXTable" + name = "unifi_ap_if" + inherit_tags = ["ap_name", "ap_location"] + +# fields +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifName" + name = "name" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifOperStatus" + name = "status" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifAlias" + name = "ifAlias" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPromiscuousMode" + name = "promiscuous_mode" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifConnectorPresent" + name = "has_connector" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPhysAddress" + name = "mac" + conversion = "hwaddr" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInOctets" + name = "rx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInUcastPkts" + name = "rx_ucast_pkt" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutOctets" + name = "tx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutUcastPkts" + name = "tx_ucast_pkt" + +# Access point: Kontor + +[[inputs.snmp]] + agents = [ "192.168.10.22" ] + version = 2 + community = "public" + interval = "60s" + timeout = "30s" + +# meta information +# this will be added automatically as a tag to the next snmp.table +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysName.0" + name = "ap_name" + is_tag = true + +[[inputs.snmp.field]] + oid = "RFC1213-MIB::sysLocation.0" + name = "ap_location" + is_tag = true + +# table +[[inputs.snmp.table]] +# Using the oid here will query all fields automatically! +# Be careful when using the oid on inputs.snmp.table as this will +# produce a lot of information +# oid = "IF-MIB::ifXTable" + name = "unifi_ap_if" + inherit_tags = ["ap_name", "ap_location"] + +# fields +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifName" + name = "name" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifOperStatus" + name = "status" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifAlias" + name = "ifAlias" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPromiscuousMode" + name = "promiscuous_mode" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifConnectorPresent" + name = "has_connector" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifPhysAddress" + name = "mac" + conversion = "hwaddr" + is_tag = true + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInOctets" + name = "rx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCInUcastPkts" + name = "rx_ucast_pkt" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutOctets" + name = "tx_bytes" + +[[inputs.snmp.table.field]] + oid = "IF-MIB::ifHCOutUcastPkts" + name = "tx_ucast_pkt" + -- cgit v1.2.3