[Pkg-monitoring-maintainers] Bug#549655: ganglia-webfrontend: The script pie.php creates wrong pie charts.

Jochen Hein jochen at jochen.org
Sat Dec 1 19:44:20 GMT 2018


Package: ganglia-webfrontend
Version: 3.6.1-3
Followup-For: Bug #549655

I've just had a look at the report and could (temporarily) reproduce it.

First some hints for a reproducer.  In the cluster view we display a
heatmap as the default (and no pie chart).  We can either set
  $conf['heatmaps_enabled'] = 0;
or toggle the host display off with "Show Hosts Scaled:" = "None" in the
cluster view to get a pie chart with hosts up/down.

With these settings I got a gray pie with 100% hosts up. I tried your patch
and got a green pie as expected.  Now I've reverted your patch and still have
a green pie...

I wanted to try this patch instead of your's:

--- /usr/src/ganglia-web-3.6.1/pie.php  2014-04-04 12:20:44.000000000 +0200
+++ pie.php     2018-12-01 20:33:24.468726328 +0100
@@ -150,6 +150,8 @@
       $from = 0;$to = 0;
       for ($i = 0; $i < $n; $i++) {
         $this->angles[$i] = $this->roundoff( ($this->data[$i][0] * 360) / doubleval($this->sum));
+        if ( $this->angles[$i]>360 )
+          $this->angles[$i]=360;
       }
       $this->draw_slices( $this->center_x, $this->center_y, $this->angles, $this->colors );
     }

I now see that this shouldn't make a difference since we have in draw_slices():

286           if( $to > 360 )
287             $to = 360;

For now I'm unable to reproduce and don't have a fix, but my guess is some rounding error.
What's your host count?



More information about the Pkg-monitoring-maintainers mailing list