I want to have a following alert text: Instance 211.111.11.111:9111 has 60 point of Memory Usage when Threshold is 50. Investigate the problem
So I want to template instance ip and last value of Memory Usage right now,
I have tried to use {{ $values.B }} and it resulted in .
Only success I had when using {{ $value }} and as output I got this information:
Instance 211.111.11.111:9111 has [ var='B0' metric='100 -
(
avg(node_memory_MemAvailable_bytes{job="node-exporter", instance="211.111.11.111:9111"}) /
avg(node_memory_MemTotal_bytes{job="node-exporter", instance="211.111.11.111:9111"})
* 100
)
' labels={} value=41.96771814524034 ] % of Memory Usage. Investigate the problem
And out of this I need to get value=41.96771814524034
Hi @ldrascic ldrascic I have tried using {{ $values.B.Value }}
But it has resulted in < no values > message being show, thank you for additional links I will also look into them.
I guess it makes difference if you are using Reduce (like in my example) or Classic condition (your example). Try solution that was proposed in next answer:
{{ $values.B0.Value }}
Also, the printf "%.1f" part does not work with classic condition .