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.
Personal Internet VMware PHP Linux Shell Bluecoat Proxy Windows Hardware Virtualization Nagios MySQL DB Monitoring Mail Android Network Wyse Hacks Tomcat Postgres Apple Mac Backup BSD ZFS Solaris SmartOS Unix Multimedia Perl Database MongoDB CMS OTRS FreeBSD Wordpress LXC Nginx Proxmox DNS Graphics GlusterFS Security Chef HAProxy Icinga Ansible HTML MariaDB Containers Rancher Docker AWS ELK Kibana Logstash Filebeat Varnish PGSQL PostgreSQL ElasticSearch CouchDB Bash Macintosh Container Minio Grafana InfluxDB Databases NFS OSSEC SystemD Java Zoneminder Surveillance Elasticsearch SSL TLS Icingaweb2 Cloud Wireless Kubernetes Ubuntu