For our network team I prepared a dashboard in Grafana a couple of months ago. On this dashboard they can select the wanted switch, monitored by Icinga2, and then select specific interfaces to see graphs:
The interface has to be selected from a field called NIC. Grafana retrieves this list of available interfaces with the following query:
SHOW TAG VALUES FROM $check WITH KEY = "service" WHERE "hostname" =~ /^$hostname$/ AND "service" =~ /Interface/
As you can see this query goes through the measurements table "$check", which is check_nwc_health in my case. It selects only the tag values from the selected host ($hostname) and makes sure that only services containing "Interfaces" are shown (otherwise it would also show up CPU Usage because this is also checked by check_nwc_health).
The problem? I was informed today that Grafana isn't showing the "TenGigabit" interfaces. I verified and as you can see in the screenshot above, there is indeed no TenGigabitEthernet interface listed. Why's that?
I checked in Icingaweb2 and didn't see it at first. But on the second view, finally, I saw it:
The letter I in "Interface" is a capital letter for the GigabitEthernet checks, but a small/lowercase "i" in "interface" for the ThenGigabitEthernet checks.
Until today I assumed that the regular expression in the InfluxDB query would show case insensitive matches, but obviously that's not the case. Unfortunately simply adding a /i behind the query does not do the trick. In my case I decided to solve this with optional upper and an optional lower case letter:
SHOW TAG VALUES FROM $check WITH KEY = "service" WHERE "hostname" =~ /^$hostname$/ AND "service" =~ /[I]?[i]?nterface/
All the interfaces are showing up now:
No comments yet.
AWS Android Ansible Apache Apple Atlassian Automation BSD Backup Bash Bluecoat CMS Chef Cloud Consul Container Containers CouchDB DB DNS Database Databases Docker ELK ElasticSearch Elasticsearch Filebeat FreeBSD GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Icingaweb2 InfluxDB Internet Java Kibana Kubernetes LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Rancher SSL Security Shell SmartOS Solaris Surveillance SystemD TLS Tomcat Ubuntu Unix VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder