Percentege of memory used

Hello,

I am trying to figure out the right query to display the percentage of memory used of a cisco device. I pull via SNMP the memory free and memory used. What I done so far is:

SELECT last(“cempMemPoolHCUsed”) / 12613160960*100 FROM “snmp” WHERE (“hostname” = ‘vfw3-lon1.netops.tmcs’) AND timeFilter GROUP BY time(__interval) fill(null)

Where 12613160960 is the total device memory gathered from show command:

Used memory: 103315392 bytes ( 1%)


Total memory: 12613160960 bytes (100%)

Most used memory: 1321899472 bytes (10%)

However, this query change the value returned in relation to the time range used in grafana (i.e. last 5 minutes is 0.8 last 6 hours is 28) What I was expecting is to see the percentage (1%) no matter which time range used

Suggestions?

Hello @Federico_Olivieri,
This might sound like a silly question, but I’m trying to understand your problem better. What time filter did you use to get the 1% result with your query above, and why can’t you use that same timeFiltere in grafana? Thanks!

Hello!
Thanks for your reply. To be honest it was months ago. I do not remember very well what exactly the problem was. I managed to figure it out anyway :slight_smile: