Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Aug 17, 2017 2:49 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: WP not overwriting LABEL statement
PostPosted: Wed Oct 12, 2016 3:48 pm 
Offline
Cacti User
User avatar

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 90
Hi, me again

I'm working on a sort of grid with stats and using templates per sensor type.

Config Before

NODE SENSOR_CPU
LABELOUTLINECOLOR none
LABELBGCOLOR 204 255 204
ICON 70 20 box
USESCALE none in percent

NODE f48_cpu
TEMPLATE SENSOR_CPU
LABEL cpu
POSITION f48_grid 0 -50

Config After

NODE SENSOR_CPU
LABEL {node:this:bandwidth_in:%.1f}%
LABELOUTLINECOLOR none
LABELBGCOLOR 204 255 204
ICON 70 20 box
USESCALE none in percent

NODE f48_cpu
TEMPLATE SENSOR_CPU
LABEL cpu
POSITION f48_grid 0 -50

I had to manually remove the "LABEL" by editing every host. Is this an expected behaviour?

I normally use a host as a test and once I've got everything i wanted I create a template and apply to it and every "templated" value gets replaced.

Cheers,

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Thu Oct 13, 2016 4:07 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5117
Location: United Kingdom
"before" and "after" what?

Yes, it is expected if you just added the TEMPLATE line. Weathermap has no way to know that you didn't want to use a template for the fonts and colours but override the label text.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Thu Oct 13, 2016 7:59 pm 
Offline
Cacti User
User avatar

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 90
Hi Howie,

Thanks for your answer. I've just wrongly assumed that once you apply the template it would replace every duplicated statement.

I assumed that because some are being replaced, for example

Original config (before applying template)

NODE node09601
LABEL uptime
LABELBGCOLOR none
LABELOUTLINECOLOR none
ICON 70 20 box
POSITION 1792 206

After applying the template

NODE node09601
TEMPLATE SENSOR_UPTIME
LABEL uptime
LABELBGCOLOR none
POSITION 1792 206


2 lines were removed from the node config.

Template config

NODE SENSOR_UPTIME
LABEL {node:this:bandwidth_in:%d} d
LABELOUTLINECOLOR none
LABELBGCOLOR 255 204 204
ICON 70 20 box
USESCALE none in percent

It's fine then, not a big issue.

Cheers,

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Fri Oct 14, 2016 3:21 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5117
Location: United Kingdom
OK - so this is using the weathermap editor? (You still didn't say what before/after means!)

Yes, in that case, anything in the node that is *identical* to the template will not be written. If it's a different setting though (e.g. two different labels) then that will stay.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Sun Oct 16, 2016 7:55 pm 
Offline
Cacti User
User avatar

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 90
Howie wrote:
OK - so this is using the weathermap editor? (You still didn't say what before/after means!)

Yes, in that case, anything in the node that is *identical* to the template will not be written. If it's a different setting though (e.g. two different labels) then that will stay.


Sorry, people keep complaining about my lack of context..=(

What I meant with before/after was to show you how the configuration was before I added the "template SENSOR_UPTIME" line to the node (node09601) configuration.

But of course it was my mistake, it's always the most specific statement which prevails.

Off topic question:

I got this target: TARGET gauge:{map:munin_chc}/devicef00-diskstats_utilization-sda-util-g.rrd:42:-
and this label: {node:this:bandwidth_in:%k}

but when the result is more than 999.99m it doesn't show the G or any other prefix. How can I troubleshoot this?

This one is showing 829.83m

ds[42].index = 0
ds[42].type = "GAUGE"
ds[42].minimal_heartbeat = 600
ds[42].min = 0.0000000000e+00
ds[42].max = NaN
ds[42].last_ds = "0.841059602649007"
ds[42].value = 2.5231788079e+01
ds[42].unknown_sec = 0

This one is showing 2.34 (without any prefix)

ds[42].index = 0
ds[42].type = "GAUGE"
ds[42].minimal_heartbeat = 600
ds[42].min = 0.0000000000e+00
ds[42].max = NaN
ds[42].last_ds = "2.34503311258278"
ds[42].value = 9.8491390728e+01
ds[42].unknown_sec = 0

Cheers,

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Mon Oct 17, 2016 3:41 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5117
Location: United Kingdom
Pucho wrote:
Howie wrote:
OK - so this is using the weathermap editor? (You still didn't say what before/after means!)

Yes, in that case, anything in the node that is *identical* to the template will not be written. If it's a different setting though (e.g. two different labels) then that will stay.


Sorry, people keep complaining about my lack of context..=(

What I meant with before/after was to show you how the configuration was before I added the "template SENSOR_UPTIME" line to the node (node09601) configuration.


Right, I can see that, but HOW did you add it? - since you expected to have other lines disappear, I guessed you meant the using the WM editor.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Mon Oct 17, 2016 3:47 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5117
Location: United Kingdom
Pucho wrote:
Off topic question:

I got this target: TARGET gauge:{map:munin_chc}/devicef00-diskstats_utilization-sda-util-g.rrd:42:-
and this label: {node:this:bandwidth_in:%k}

but when the result is more than 999.99m it doesn't show the G or any other prefix. How can I troubleshoot this?

This one is showing 829.83m

ds[42].index = 0
ds[42].type = "GAUGE"
ds[42].minimal_heartbeat = 600
ds[42].min = 0.0000000000e+00
ds[42].max = NaN
ds[42].last_ds = "0.841059602649007"
ds[42].value = 2.5231788079e+01
ds[42].unknown_sec = 0

This one is showing 2.34 (without any prefix)

ds[42].index = 0
ds[42].type = "GAUGE"
ds[42].minimal_heartbeat = 600
ds[42].min = 0.0000000000e+00
ds[42].max = NaN
ds[42].last_ds = "2.34503311258278"
ds[42].value = 9.8491390728e+01
ds[42].unknown_sec = 0

Cheers,


This is correct.

That's because 999.99m is nearly 1, so any higher doesn't need units until you get to near 1000.
m=milli (1/1000) not mega (that's M).

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: WP not overwriting LABEL statement
PostPosted: Thu Oct 20, 2016 9:49 pm 
Offline
Cacti User
User avatar

Joined: Wed Jul 20, 2016 8:00 pm
Posts: 90
Thanks for your answer.

Now I realised I was looking at that graph expecting to see "disk usage" but is more like "disk load" %. Probably wasn't paying much attention to it =p

btw, you're right, I only edit configs manually when there is no way on doing it by the web editor.

_________________
Cacti - 0.8.8h
Poller Type - CMD
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 6
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group