Ad Widget

Collapse

Network bandwidth metering script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sire
    Senior Member
    • Jul 2010
    • 210

    #1

    Network bandwidth metering script

    Hi all,

    I have written a Perl script that (very) roughly meters network bandwidth to a host selected on a network map. The script can be added to Zabbix through Administration->Scripts menu.
    Metering is done by sending ICMP pings of different size and calculating network bandwidth based on round-trip time (RTT) and packet size according to the formula:
    Bandwidth = Packet size / (RTT/1000/2).
    Metered bandwidth greatly depends on the packet size. The highest speed is achieved at the largest packet size (65535 bytes including ICMP and IP headers). One more thing to note is that metered bandwidth is the average of upload and download bandwidths.

    Comments are welcome.
    Attached Files
    Last edited by sire; 01-10-2010, 19:35. Reason: Added screenshot
    Regards,
    Sergey Syreskin

    Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

    Temporary out of Zabbix business
  • dima_dm
    Senior Member
    • Dec 2009
    • 2697

    #2
    I think, is useful to add also bandwidth speed in bps.

    Comment

    • sire
      Senior Member
      • Jul 2010
      • 210

      #3
      Originally posted by dima_dm
      I think, is useful to add also bandwidth speed in bps.
      Do you mean that the script should automatically scale the numbers and add a correct suffix: K, M if necessary?
      Regards,
      Sergey Syreskin

      Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

      Temporary out of Zabbix business

      Comment

      • dima_dm
        Senior Member
        • Dec 2009
        • 2697

        #4
        Originally posted by sire
        Do you mean that the script should automatically scale the numbers and add a correct suffix: K, M if necessary?
        No. bps (bit per second) and Bps (Byte per second).
        Than more devices along the trace of packets (switch, router, firewall etc), so much the worse an estimation of a bandwidth.
        Example:
        Code:
        I tested this script on 100Mbps link 
        1 hop, 1 device 
        IP packet size 84 B:    RTT = 0.157 ms, speed = 696.7 KBps
        IP packet size 150 B:   RTT = 0.180 ms, speed = 1323.8 KBps
        IP packet size 1500 B:  RTT = 0.675 ms, speed = 4259.3 KBps
        IP packet size 10000 B: RTT = 2.117 ms, speed = 9200.1 KBps
        IP packet size 64000 B: RTT = 11.272 ms, speed = 11084.6 KBps
        
        Speed (min/avg/max) = 696.7/5312.9/11084.6 KBps
        11084.6 KBps= 88676,8 Kbps= 88,7 Mbps
        
        6 hop, 9 devices
        IP packet size 84 B:    RTT = 1.457 ms, speed = 75.1 KBps
        IP packet size 150 B:   RTT = 1.450 ms, speed = 164.3 KBps
        IP packet size 1500 B:  RTT = 4.517 ms, speed = 636.5 KBps
        IP packet size 10000 B: RTT = 9.811 ms, speed = 1985.2 KBps
        IP packet size 64000 B: RTT = 40.066 ms, speed = 3118.5 KBps
        
        Speed (min/avg/max) = 75.1/1195.9/3118.5 KBps
        3118.5 KBps=24948 Kbps=24,9 Mbps

        Comment

        • sire
          Senior Member
          • Jul 2010
          • 210

          #5
          Originally posted by dima_dm
          No. bps (bit per second) and Bps (Byte per second).
          Than more devices along the trace of packets (switch, router, firewall etc), so much the worse an estimation of a bandwidth.
          I'll add a -b option to show Kbps. And thanks for the report.
          Regards,
          Sergey Syreskin

          Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

          Temporary out of Zabbix business

          Comment

          • sire
            Senior Member
            • Jul 2010
            • 210

            #6
            Here is a new version with the promised -b option.
            Attached Files
            Regards,
            Sergey Syreskin

            Monitored hosts: 2646 / Active items: 23604 / Server performance: 765.74

            Temporary out of Zabbix business

            Comment

            Working...