Personal tools
You are here: Home Projects Nagios Plugins check_iftraffic


by Herbert Straub last modified 2011-01-22 15:03

The check_iftraffic Nagios plugin read the Interface TX and RX octects via snmp. This is a modified version of the original check_iftraffic plugin from nagios-exchange.


  • This version supports SNMP version 2c with 64 bit counter
  • Calculate the warning and critical thresholds from unit with base 2**X and 10 ** X
  • Updated Copyright
  • Updated help and license output
  • New option -d for the temporary data files
  • New option -x für debuging
  • Print version information

Performance Graph NagPerfDiag

Template is included in NagPerfDiag. Datatype Information:

  • DS1: Gauge
  • DS2: Gauge
  • DS3: Counter
  • DS4: Counter


Call -H -s 1 -i "Port #3" -b 1 -u gibits -c 100


Total RX Bytes: 102752022.00 B, Total TX Bytes: 244384944.00 B<br>Average
Traffic: 1020.87 B/s (0.0%) in, 967.92 B/s (0.0%) out|inUsage=0.0%;85;100;;
outUsage=0.0%;85;100;; inAbsolut=99581192B;114085069;134217728;;

Help Output

Copyright (C) 2004 Gerd Mueller / Netways GmbH
Copyright (C) 2006,2007,2009,2011 Herbert Straub <>

Version: 2.1

Usage: -H host -i if_descr -b if_max_speed [ -w warn ] [ -c crit ]


-h --help
    This text.

-l --license
    The license information.

    Check interface on the indicated host.

-C --community STRING
    SNMP Community.

-s --snmp_version 1 | 2 | 2c
    Specify the snmp version. The current version supports 1 and 2c.

-i --interface STRING
    Interface Name

-b --bandwidth INTEGER
    Interface maximum speed in kilo/mega/giga/Bits per second. See
    the units options for details. This value is used for the
    warning and critical threshold calculation.

-u --units STRING
    Specify the unit of the bandwith options
    Possible values for binary prefix:
      Tibit = tebibits/s ( 2 ** 40 bits )
      Gibit = gibibits/s ( 2 ** 30 bits )
      Mibit = mebibits/s ( 2 ** 20 bits )
      Kibit = kibibits/s ( 2 ** 10 bits )

    Possible values for decimal prefix
      Tbit = terabits/s ( 10 ** 12 )
      Gbit = gigabits/s ( 10 ** 9 )
      Mbit = megabits/s ( 10 ** 6 )
      kbit = kilobits/s ( 10 ** 3 )

      b = bits/s

    Compatibility to older version of check_iftraffic
      g = Gbit
      m = Mbit
      k = kbit

    The unit string is not case sensitive.

    For a detailed description read:

-o --output Bytes | bits (default is Bytes)
    Specify the output unit. The default is Bytes/s
    For a detailed description read:

-w --warning INTEGER
    % of bandwidth usage necessary to result in warning status.
    Default: 85%

-c --critical INTEGER
    % of bandwidth usage necessary to result in critical status.
    Default: 98%

-M --max INTEGER
    Max Counter Value of net devices in kilo/mega/giga/bytes.

-d --directory STRING
    Directory for temporary and history files.

-x --history
    Writing history in temporary file - for debugging purposes.

-v --version
    Print version information.

The latest and greatest version of check_iftraffic can be found on:


Copyright (C) 2004 Gerd Mueller / Netways GmbH
Copyright (C) 2006,2007,2009,2011 Herbert Straub <>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307
Authors:Herbert Straub Gerd Mueller Markus Werner Adrian Wieczorek
Version:2.1 2011-01-22
Document Actions