Announcement

Collapse
No announcement yet.

check_graph_traffic adaptation for Cisco 4GB counter reset

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • check_graph_traffic adaptation for Cisco 4GB counter reset

    Because cisco resets the in/out bytes counters after 4GB I got weird output from check_graph_traffic with my routers.
    I made a quick and dirty change for this in check_graph_traffic at line 261 just before the '$in_traffic =' line:
    Code:
    # cisco resets the counters every 4GB ....
    if ($in_bytes < $last_in_bytes) {$last_in_bytes -= 4294967296};
    if ($out_bytes < $last_out_bytes) {$last_out_bytes -= 4294967296};
    Probably there already is a plugin for this, but changing this plugin was faster than looking for another one.
    It works fine here, maybe someone else can use this too..

    Regards
    Menno van Bennekom

  • #2
    julio , wistof, it's for you
    Intel(R) Xeon(TM) CPU 3.4GHz - MemTotal : 1034476 kB
    Centreon 2.4.1 - Nagios 3.2.1 - Nagios Plugins 1.4.15 - Manubulon Plugins tuné
    Fedora Core 5 - 2.6.20-1.2320

    Comment


    • #3
      Re: check_graph_traffic adaptation for Cisco 4GB counter res

      Menno,

      YOU ARE THE MAN!!!!!!!!!

      Here you help me out again...

      I have both Foundry and Cisco devices that behave in this manner. I will implement your additions to the check_graph_traffic.pl script and see if you fix me yet again!

      Thanks!

      Trevor

      Comment


      • #4
        counter reset error re-introduced in 1.3.3?

        I installed version 1.3.3 lately and that contained a new check_graph_traffic.pl. I noticed the 4GB counter reset doesn't work anymore. I think this is because the check_graph_traffic.pl script now calculates in bits instead of in bytes, but didn't adapt the 4GBytes counter to bits.
        So to correct this I made the following changes:

        line 262
        ## Count must round at 4294967296 Bytes
        line 268
        $total = 4294967296 * 8 - $last_in_bits + $in_bits;
        line 280
        $total = 4294967296 * 8 - $last_out_bits + $out_bits;

        Also in this version the perfparse traffic has been given a decimal comma instead of a dot and my perfparse database doesn't like that. For example when I now make a new service the decimal part is now part of the unit (for example plugin-output is 2700,1Bits/s, perfparse then shows 2700 as value and (,1Bits/s) as unit. So I commented those lines out:

        line 363
        # $in_perfparse_traffic_str =~ s/\./,/g;
        line 364
        # $out_perfparse_traffic_str =~ s/\./,/g;

        Another small error is that the metric system is now used (1k = 1000 bits, was 1024 in older plugin) but at 2 places this is not adapted, lines 332 and 341 still divide by 1048576 instead of by 1000000.

        Regards
        Menno van Bennekom

        Comment


        • #5
          Thanks a lot

          If some developper could take care of this :wink:
          Intel(R) Xeon(TM) CPU 3.4GHz - MemTotal : 1034476 kB
          Centreon 2.4.1 - Nagios 3.2.1 - Nagios Plugins 1.4.15 - Manubulon Plugins tuné
          Fedora Core 5 - 2.6.20-1.2320

          Comment

          Working...
          X