fix interfaces names/add subinterface check
diff --git a/sensu/files/sensu.conf b/sensu/files/sensu.conf
index 6a1bfe1..6a7b1b1 100644
--- a/sensu/files/sensu.conf
+++ b/sensu/files/sensu.conf
@@ -26,12 +26,20 @@
{%- if client.get('plugin', {}).network_monitoring is defined %}
{%- for device_name, device in client.network_device.iteritems() %}
{%- for interface_name, interface in device.interface.iteritems() %}
-remote_{{ device_name }}_{{ interface_name }}_interface_up:
- command: "/etc/sensu/plugins/check_snmp_int.pl -H {{ device.management.address }} -C test -n ^{{ interface_name }}$"
+remote_{{ device_name }}_{{ interface_name|replace('/', '_')|replace('.', '_') }}_interface_up:
+ command: "/etc/sensu/plugins/check_snmp_int.pl -H {{ device.management.address }} -C {{ device.community }} -n ^{{ interface_name }}$"
interval: 60
occurrences: 1
subscribers:
- remote-network
+{%- for subinterface_name, subinterface in device.interface.{{ interface_name }}.iteritems() %}
+remote_{{ device_name }}_{{ subinterface_name|replace('/', '_')|replace('.', '_') }}_interface_up:
+ command: "/etc/sensu/plugins/check_snmp_int.pl -H {{ device.management.address }} -C {{ device.community }} -n ^{{ subinterface_name }}$"
+ interval: 60
+ occurrences: 1
+ subscribers:
+ - remote-network
+{%- endfor %}
{%- endfor %}
{%- endfor %}
{%- endif %}