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

traffic accounting bug in case interface has only one direction traffic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Billing
    • Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

    Description

      poll-billing.php line 152:

       

      if ($in_delta == $data['in'] || $in_delta == $data['in']) {
                      // Deltas are equal to counters. Clearly fail.
                      echo("Deltas equal counters. Resetting.");
                      $in_delta  = 0;
                      $out_delta = 0;
      }
      

       

      Assumption (at least for our use case) is wrong. But also the logic implemented - referring twice to same condition (could be just a typo).

      For example we use a lot of Cisco Nexus brokers (basically nexus switch in tap mode), but it is same for any passive collection - you can have ports which have only packets flowing in a single direction.

      Anyhow this is my simple proposal for a fix, instead of code above (for sure could be further optimized):

       

                  if ($in_delta == $data['in']) {
                      // Deltas are equal to counters. Clearly fail.
                      echo("In Deltas equal counters. Resetting.");
                      $in_delta  = 0;
                  }
                  if ($out_delta == $data['out']) {
                      // Deltas are equal to counters. Clearly fail.
                      echo("Out Deltas equal counters. Resetting.");
                      $out_delta  = 0;
                  }
      

       

       

      Version info:

      Path: stable
      URL: https://svn.observium.org/svn/observium/branches/stable
      Relative URL: ^/observium/branches/stable
      Repository Root: https://svn.observium.org/svn
      Repository UUID: 61d68cd4-352d-0410-923a-c4978735b2b8
      Revision: 13283
      Node Kind: directory
      Last Changed Author: adama
      Last Changed Rev: 13242
      Last Changed Date: 2024-01-02 14:44:46 +0000 (Tue, 02 Jan 2024)

      Attachments

        Activity

          People

            landy Mike Stupalov
            jdjurici Josip Duricic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: