It is possible to calculate dynamic value in LABEL

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
widek611
Posts: 8
Joined: Fri May 15, 2009 1:52 am
Location: Poland

It is possible to calculate dynamic value in LABEL

Post by widek611 »

Hello
There is info howto add additional info to LABEL from the TARGET line, which fetches data from a Cacti rrd file:
http://www.network-weathermap.com/artic ... -data.html

I have a question. I try to display something like this: "used_mem from total_mem", but i have only free_mem and total_mem values. I want calculate used_mem like this: used_mem=total_mem-free_mem

I try something this:
NODE ifsapp_RAM
TARGET scale:1024:/www/cacti/rra/35/1678.rrd:mem_free:- scale:1024:/www/cacti/rra/35/1679.rrd:-:mem_total
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=1436
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=1436&rra_id=0&graph_height=120&graph_width=500&g_start=4&g_end=0
POSITION ifsapp_RAM_icon 0 +27
LABEL {node:this:bandwidth_out:%0.2k-node:this:bandwidth_in:%0.2k} from {node:this:bandwidth_out:%0.2k}
MAXVALUE 4300000000
Or maybe from more sources like this:

"(mem_total-mem_free-mem_buffer-mem_cache) from mem_total"


Please help.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

What happens when you use your example code? That looks about right to me...

You can't do the second way (with calculations) though.

EDIT: Sorry - just looked closer - the second part of the LABEL is OK. The first part (with the calculation) won't work.

You should be able to have another hidden node to do the calculation though:

NODE hidden
TARGET scale:1024:blah.rrd:mem_total:- - scale:1024:blah.rrd:mem_free:-
POSITION 100000 100000

NODE label
LABEL {node:hidden:bandwidth_in:%.2k} used.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
widek611
Posts: 8
Joined: Fri May 15, 2009 1:52 am
Location: Poland

Post by widek611 »

Howie wrote:What happens when you use your example code? That looks about right to me...

You can't do the second way (with calculations) though.

EDIT: Sorry - just looked closer - the second part of the LABEL is OK. The first part (with the calculation) won't work.

You should be able to have another hidden node to do the calculation though:

NODE hidden
TARGET scale:1024:blah.rrd:mem_total:- - scale:1024:blah.rrd:mem_free:-
POSITION 100000 100000

NODE label
LABEL {node:hidden:bandwidth_in:%.2k} used.
OK. It works perfect. I used something like this without hidden Node:
NODE ifsapp_RAM
TARGET scale:1024:/www/cacti/rra/35/1679.rrd:mem_total:- -scale:1024:/www/cacti/rra/35/1678.rrd:mem_free:- -scale:1024:/www/cacti/rra/35/1677.rrd:mem_cache:- -scale:1024:/www/cacti/rra/35/1676.rrd:mem_buffers:- scale:1024:/www/cacti/rra/35/1679.rrd:-:mem_total
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=1436
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=1436&rra_id=0&graph_height=120&graph_width=500&g_start=4&g_end=0
POSITION ifsapp_RAM_label 0 +17
LABEL {node:this:bandwidth_in:%0.2k}/{node:this:bandwidth_out:%0.2k}
MAXVALUE 4300000000
Thanks very much
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests