Weathermap Pie Chart Issue

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Weathermap Pie Chart Issue

Post by jackie »

Hi all,

We are using cacti 0.8.8b in combo with PHP Weathermap 0.97c and it is an incredibly powerful tool for monitoring network traffic and device status. Thanks to everyone for your work on this!

My question is with the pie charts on weathermap. We are using the pie chart feature to show the usage of DHCP pools. However, when the pool gets close to 100% full, the pie chart isn't filled with color, but reverts to the outline color. I've attached a picture of what we are seeing. The pie should be completely red.

Any ideas how to resolve this? I'll try to come up with some simple weathermap code that illustrates it.

Thanks,
Jackie
Attachments
piechart100.jpg
piechart100.jpg (1.26 KiB) Viewed 4654 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Weathermap Pie Chart Issue

Post by Howie »

I'm not too surprised - that's not a very well tested part of the code... It looks simple enough though - just '(inpercent * 360) / 100' to decide the angle of the 'wedge'.
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!)
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Thanks, Howie. I suspect our percentages are coming out slightly over 100% at times (due to inexact numbers), so that is causing the angle to wrap past 360 to 1 degree. The fix for us is to add the min function to two lines in WeatherMapNode.class.php:

if($this->iconfile=='inpie') $segment_angle = min(((($this->inpercent)/100) * 360), 360);

if($this->iconfile=='outpie') $segment_angle = min(((($this->outpercent)/100) * 360), 360);

Really appreciate your help with that!

While I have your ear though, I was wondering about something else related to pie charts. There is a feature you have which allow the artificial icon to follow the color of the label background color by specifying 'copy' as the colour for AICONFILLCOLOR. That is what I'm using to turn the pie chart red when the percentage exceeds 90%.

However, since the fill color for the pie chart is turning red, I have to display the reverse statistic on the pie. For example, for DHCP usage I want the used address percentage shown on the pie chart. But in the weathermap setup, I actually configure the pie to display the free address percentage (in light grey) and the color the background (which is the used percentage) using the 'copy' feature of AICONFILLCOLOR. The pie charts go counter-clockwise. The "fill" wedges are green and turn red with usage > 90%.

The issue come up that we have some pools that don't report the number of free addresses. I have the max number and the used address count, but not a free count in an rra. I can't figure out any way to calculate the free address count within the weathermap configuration. I tried setting up a TARGET using total address count and then subtracting used, but since they are both gauges the "-gauge" syntax didn't work on my first try. Should I be able to do this?

What would be really cool is if I could specify the 'copy' parameter for AICONOUTLINECOLOR. That would work really well for pie charts as we could color the true wedge! Was wondering if that could be a feature request?

Thanks for any ideas on this,
Jackie
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Found my error in syntax. The "-gauge:xxx.rrd" syntax does indeed work! So, I can subtract the used from total to get the free statistics. Very cool!

My request for 'copy' on AICONOUTLINECOLOR still stands though. Was wondering if that is a difficult feature to add?

Thanks, Howie! The weathermaps are an amazing addition to cacti.

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

Re: Weathermap Pie Chart Issue

Post by Howie »

I have a low-priority feature to try and make 'real' math expressions work in targets... :-)

No, I will check out the 'copy' on AICONOUTLINECOLOR. It shouldn't be hard.
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!)
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Howie,

I had a few minutes to look at adding 'copy' to AICONOUTLINECOLOR yesterday, so I tried it out on a test cacti server. These are the changes I came up with which seem to work. Also, I've attached a testpies.conf file I'm using to verify operation.

I found the a 0% pie wasn't being colored properly, so I added code to change a 0% wedge to 1%.

Thanks for any feedback on this!
Jackie
Attachments
pies.tar.gz
(1.1 KiB) Downloaded 238 times
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: Weathermap Pie Chart Issue

Post by msantana »

Well, shamefully I'm only a year behind you guys. Can anyone share a more enhanced config using pie charts?

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

Re: Weathermap Pie Chart Issue

Post by Howie »

More enhanced?
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!)
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Msantana,

If you are having problems getting your pie chart weathermap going, I'd suggest you post the full map configuration here. Also, I'm sure you've checked, but did you see any errors in the log file?

I'm also curious if the test pie chart weathermap I posted works for you.

Jackie
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Attached is a weathermap configuration file we use to monitor dhcp pools, and the resulting map. As you can see the pie charts turn red when a threshold is exceeded.

Jackie
Attachments
piecharts_dhcp.jpg
piecharts_dhcp.jpg (71.88 KiB) Viewed 3904 times
dhcp.txt
(30.57 KiB) Downloaded 292 times
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: Weathermap Pie Chart Issue

Post by msantana »

First, I apologize for my vague question about more enhanced. Once I studied the code I was able to understand it much better. Thanks to you Jackie.

One question remains. Although I've managed to simplify config to only four elements, I'm having problems with the color status. The pie chart appears to be on the right proportion, but as opposed to have a green or red status, the color appears black. What am I doing wrong?

I've attached to config file for your perusal.

Thank you!
Attachments
Spacedrive.zip
(1.01 KiB) Downloaded 127 times
msantana
Posts: 27
Joined: Mon May 18, 2009 8:33 am

Re: Weathermap Pie Chart Issue

Post by msantana »

I thought the problem was I left out several lines in the PIE_DEFAULT node; such as
AICONOUTLINECOLOR copy and USESCALE DEFAULT out percent.

...but still not working. :(

The specific error I'm getting is "Unrecognised config on line 39: AICONOUTLINECOLOR copy"

Any thoughts?
jackie
Cacti User
Posts: 71
Joined: Fri Sep 14, 2007 12:43 pm

Re: Weathermap Pie Chart Issue

Post by jackie »

Getting the pies to change colors actually involved changes to the weathermap php code. I modified the php code to add the feature "AICONOUTLINECOLOR copy" on pie charts. I posted the changes to php I made earlier in this discussion.

Perhaps Howie could incorporate them in the next weathermap release? Would be best to have him agree the changes are valid. I know they work for me running 0.97c.

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

Re: Weathermap Pie Chart Issue

Post by Howie »

Currently, AICONFILLCOLOR has 'copy' but not AICONOUTLINECOLOR. I'll get it in there.

I need to get the github trunk version back to a state where it's usable...
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!)
rvalverde
Posts: 4
Joined: Mon Jul 27, 2015 11:03 am

Re: Weathermap Pie Chart Issue

Post by rvalverde »

Howie wrote:I have a low-priority feature to try and make 'real' math expressions work in targets... :-)

No, I will check out the 'copy' on AICONOUTLINECOLOR. It shouldn't be hard.

Hi Howie.

First of all, congratulations for developing phpweathermap. We have been using it since 2008 and we are very satisfied with this fabulous and powerful tool.

Recently, we have decided to monitor error and discard rates of our critical routers and switches. Our datasource are RRD files and they are generated by NMIS, another management tool.

The problem I´m facing is how to divide using phpweathermap and I will explain why I need it. Below you can observe the way NMIS store and calculate some metrics:

'ifOutPkts = ifOutUcastPkts,ifOutMcastPkts,ifOutBcastPkts,ifOutDiscards,ifOutErrors,+,+,+,+',

NMIS considers ifOutPkts (total ouput packets) as a sum of these 5 SNMP variables. So, I collected the 5 values using the "IN" Target variable of phpweathermap and the ifOutErrors using the "OUT" one:

TARGET
gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:ifOutUcastPkts:-
gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:ifOutMcastPkts:
gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:ifOutBcastPkts:-
gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:ifOutDiscards:- - gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:ifOutErrors:-

gauge:/var/nmisdb/interface/router/router-wan2/router-wan2-gigabitethernet0-0-pkts_hc.rrd:-:ifOutErrors


In order to show the error/discard percantage in a label, I was searching a way to divide in phpweathermap (ifOutErrors/ifOutPkts), but I didn´t find. Could you help me?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests