Ticket #4283 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

patch for divide by zero error in dashboard cpu calculation

Reported by: kurtlidl Assigned to:
Priority: minor Milestone: 2.8
Component: System Dashboard Version: 2.8-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

When the CPU is 100% busy on a machine, the calculation of the percentage cpu throws a divide by zero error:

[Tue May 18 12:30:03 2010] [error] [client xx.xx.xx.xx] PHP Warning: Division by zero in /usr/local/freepbx/data/admin/modules/dashboard/phpsysinfo/class.BSD.common.inc.php on line 109, referer: http://host.domain.com/admin/config.php?type=setup&display=index

I didn't attempt to fix the calculation to be better, but just work around the exceptional condition to avoid the division in that case.

Attachments

d3.patch (0.7 kB) - added by kurtlidl on 05/18/10 13:38:20.

Change History

05/18/10 13:38:20 changed by kurtlidl

  • attachment d3.patch added.

05/20/10 12:49:11 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [9654]) fixes #4283 divide by zero error when bogus cpu information comes back