Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-3969

PHP error "Uncaught DivisionByZeroError: Division by zero" in Billing with CIDR at 0

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Default
    • PHP8.0

    Description

      The web interface for Billing ("Traffic Accouting") not working when we have customer(s) with billing method "CDR" but without assigned bandwith by seconds.

       

      AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught DivisionByZeroError: Division by zero in /opt/observium/21.12.11808/html/pages/bill/infoboxes.inc.php:58\nStack trace:\n#0 /opt/observium/21.12.11808/html/pages/bill.inc.php(139): include()\n#1 /opt/observium/21.12.11808/html/index.php(271): include('...')\n#2 {main}\n  thrown in /opt/observium/21.12.11808/html/pages/bill/infoboxes.inc.php on line 58'

       

      In old version (~6 months) with PHP7.3, the "0bps" worked with a "INF%" value in bar.
      Now I running 21.12.11808 with PHP8.0.

      This can be one usecase when we just want to graph without computing the 95% or calculate overusage. For example,  when an agreement is made with peer on a ratio (1:2) spread over several ports. Because "ratio" method (and overusage out of ratio) is not currently implemented, originaly I have configured with no CDR configured.

       

      I have temporary bypass the problem with assign "1" directly in database.
      Note : The webinterface not force/don't check for value and assign "0" in database if it's left blank.

      Attachments

        Activity

          [OBS-3969] PHP error "Uncaught DivisionByZeroError: Division by zero" in Billing with CIDR at 0

          Fixed in r11820.

          landy Mike Stupalov added a comment - Fixed in r11820.

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            landy Mike Stupalov
            johann Johann Mallet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: