aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2020-10-01 11:25:42 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2020-10-01 11:25:42 +0200
commit62db38129f064dc88b028cd2058c67ce577fbe2a (patch)
treee89de4c31e7cee6318f65509c7da5d0abbb556af /ansible
parenta85a827ff03e08e6de20dc8134e3974c87a8186b (diff)
downloadinfra-62db38129f064dc88b028cd2058c67ce577fbe2a.tar.gz
infra-62db38129f064dc88b028cd2058c67ce577fbe2a.tar.bz2
infra-62db38129f064dc88b028cd2058c67ce577fbe2a.tar.xz
infra-62db38129f064dc88b028cd2058c67ce577fbe2a.zip
unifi: More SNMP.
Diffstat (limited to 'ansible')
-rw-r--r--ansible/plays/templates/ops-server/telegraf.conf276
-rw-r--r--ansible/plays/templates/ops-server/telegraf.conf.j248
2 files changed, 305 insertions, 19 deletions
diff --git a/ansible/plays/templates/ops-server/telegraf.conf b/ansible/plays/templates/ops-server/telegraf.conf
index 4567e34..7b36879 100644
--- a/ansible/plays/templates/ops-server/telegraf.conf
+++ b/ansible/plays/templates/ops-server/telegraf.conf
@@ -26,8 +26,40 @@
name = "snmp_if_iftable"
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -51,13 +83,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -82,6 +115,10 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
# Device: SW nede, type: switch
[[inputs.snmp]]
@@ -104,8 +141,40 @@
name = "snmp_if_iftable"
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -129,13 +198,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -160,6 +230,10 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
# Device: SW cloud, type: switch
[[inputs.snmp]]
@@ -182,8 +256,40 @@
name = "snmp_if_iftable"
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -207,13 +313,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -238,6 +345,10 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
# Device: Over stue, type: ap
[[inputs.snmp]]
@@ -261,6 +372,36 @@
inherit_tags = ["name", "location"]
[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+
+[[inputs.snmp.table]]
oid = "UBNT-UniFi-MIB::unifiRadioTable"
name = "unifi_radio"
index_as_tag = true
@@ -272,7 +413,15 @@
index_as_tag = true
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UBNT-UniFi-MIB::unifiIfTable"
+ name = "unifi_if_table"
+ inherit_tags = ["name", "location"]
+
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -296,13 +445,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -327,6 +477,10 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
# Device: Over kjøkken, type: ap
[[inputs.snmp]]
@@ -350,6 +504,36 @@
inherit_tags = ["name", "location"]
[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+
+[[inputs.snmp.table]]
oid = "UBNT-UniFi-MIB::unifiRadioTable"
name = "unifi_radio"
index_as_tag = true
@@ -361,7 +545,15 @@
index_as_tag = true
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UBNT-UniFi-MIB::unifiIfTable"
+ name = "unifi_if_table"
+ inherit_tags = ["name", "location"]
+
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -385,13 +577,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -416,6 +609,10 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
# Device: Kontor, type: ap
[[inputs.snmp]]
@@ -439,6 +636,36 @@
inherit_tags = ["name", "location"]
[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
+
+[[inputs.snmp.table]]
oid = "UBNT-UniFi-MIB::unifiRadioTable"
name = "unifi_radio"
index_as_tag = true
@@ -450,7 +677,15 @@
index_as_tag = true
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UBNT-UniFi-MIB::unifiIfTable"
+ name = "unifi_if_table"
+ inherit_tags = ["name", "location"]
+
+#
# SNMP Fields that should be tags
+#
+
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
is_tag = true
@@ -474,13 +709,14 @@
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioName"
+ oid = "UCD-SNMP-MIB::laNames"
is_tag = true
+
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioRadio"
+ oid = "UBNT-UniFi-MIB::unifiRadioName"
is_tag = true
[[inputs.snmp.table.field]]
- oid = "UBNT-UniFi-MIB::unifiRadioOtherBss"
+ oid = "UBNT-UniFi-MIB::unifiRadioRadio"
is_tag = true
[[inputs.snmp.table.field]]
@@ -505,3 +741,7 @@
oid = "UBNT-UniFi-MIB::unifiVapUsage"
is_tag = true
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
diff --git a/ansible/plays/templates/ops-server/telegraf.conf.j2 b/ansible/plays/templates/ops-server/telegraf.conf.j2
index 61f9279..f6a1c87 100644
--- a/ansible/plays/templates/ops-server/telegraf.conf.j2
+++ b/ansible/plays/templates/ops-server/telegraf.conf.j2
@@ -40,7 +40,37 @@
name = "snmp_if_iftable"
inherit_tags = ["name", "location"]
+[[inputs.snmp.table]]
+ oid = "UCD-SNMP-MIB::laTable"
+ name = "snmp_la_table"
+ inherit_tags = ["name", "location"]
+
+[[inputs.snmp.field]]
+ name = "memTotalSwap"
+ oid = "UCD-SNMP-MIB::memTotalSwap.0"
+[[inputs.snmp.field]]
+ name = "memAvailSwap"
+ oid = "UCD-SNMP-MIB::memAvailSwap.0"
+[[inputs.snmp.field]]
+ name = "memTotalReal"
+ oid = "UCD-SNMP-MIB::memTotalReal.0"
+[[inputs.snmp.field]]
+ name = "memAvailReal"
+ oid = "UCD-SNMP-MIB::memAvailReal.0"
+[[inputs.snmp.field]]
+ name = "memTotalFree"
+ oid = "UCD-SNMP-MIB::memTotalFree.0"
+[[inputs.snmp.field]]
+ name = "memShared"
+ oid = "UCD-SNMP-MIB::memShared.0"
+[[inputs.snmp.field]]
+ name = "memBuffer"
+ oid = "UCD-SNMP-MIB::memBuffer.0"
+[[inputs.snmp.field]]
+ name = "memCached"
+ oid = "UCD-SNMP-MIB::memCached.0"
{% if device.type == "ap" %}
+
[[inputs.snmp.table]]
oid = "UBNT-UniFi-MIB::unifiRadioTable"
name = "unifi_radio"
@@ -52,16 +82,28 @@
name = "unifi_vap"
index_as_tag = true
inherit_tags = ["name", "location"]
+
+[[inputs.snmp.table]]
+ oid = "UBNT-UniFi-MIB::unifiIfTable"
+ name = "unifi_if_table"
+ 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 = "UCD-SNMP-MIB::laNames"
+ is_tag = true
+
+{% for f in [ "unifiRadioName", "unifiRadioRadio" ] %}
[[inputs.snmp.table.field]]
oid = "UBNT-UniFi-MIB::{{ f }}"
is_tag = true
@@ -73,4 +115,8 @@
is_tag = true
{% endfor %}
+[[inputs.snmp.table.field]]
+ oid = "UBNT-UniFi-MIB::unifiIfName"
+ is_tag = true
+
{% endfor %}