Griesbacher / histou

Adds templates to Grafana in combination with nagflux
GNU General Public License v2.0
35 stars 16 forks source link

Renaming check_command leads to incomplete graphs #13

Open simonmeggle opened 6 years ago

simonmeggle commented 6 years ago

Every series in InfluxDB contains the check_command which was executed by the monitoring system.
Beneath hostname/servicedescription histou also uses check_command to fetch the data from the database, which is determined by the following query:

SELECT * FROM metrics WHERE host = '__hostname__' AND service = '__servicedesc__' 
GROUP BY performanceLabel LIMIT 1

Only one check_command is used to query the database. In case of a renamed check_command you won't get the series containing the other check_command anymore....

Proposal: if there are more than one check_comamnd, OR-combine them in the series query, e.g.

SELECT mean("value") AS "FastEthernet0/35_usage_in-value", 
...
...
AS "FastEthernet0/35_usage_in-crit-max" 
FROM "metrics" 
WHERE "host" = '__hostname__' 
AND "service" = 'snmp_interface_health'  
AND ("command" = 'check_nwc_health_local' OR "command" = 'check_nwc_health')  <<<<
AND "performanceLabel" = 'FastEthernet0/35_usage_in' 
AND time > 1497058120s and time < 1505828288s 
GROUP BY time(3h) fill(null);
Griesbacher commented 6 years ago

I'm aware of the problem, but due the significant changes and the lack of time, it will take some time till I'll look into it.

simonmeggle commented 6 years ago

👍