Singlestate sum of two values

Hello!

In Nagios we have a check, that will show us the sum of error for a special check. In our case the errors of Windows Disk Space.
This I can show with an singlestate in Grafana:

SELECT last(“value”) FROM “metrics” WHERE “host” = ‘’ AND “service” = 'Count_Service_NRPE_Windows_Diskspace_critical’
for example: 4
SELECT last(“value”) FROM “metrics” WHERE “host” = ‘’ AND “service” = 'Count_Service_NRPE_Windows_Diskspace_warning’
for example: 2

Now I want to create a new singlestate where I can see the sum of the two counters.
for example: 6
I want to see the sum of the tow counters.

I have tried in influx but i got the solution of the query?

maybe anyone can help me.

rg
Hansi

You need to sum them in your query, Not sure InfluxDB supports this (the query language has some limits)

If you use mysql or postgres as nagios datastore and use livestatus you can query those directly from the nagios database instead of from influx and can do any calculations you need in that query.