
check_traffic.sh
Description:
This plugin checks traffic usage and jitter of:
1) a single interface on a single network device
2) multiple interfaces on a single network device
3) interface(s) on a single or multiple network devices
The amount of interfaces is not limited. However, aggregation of too many interfaces might make impact on accuracy. The value of amount less than 8 interfaces is recommended.
Both 32-bit and 64-bit counters are supported.
Usage:
check_traffic.sh [ -v ] [ -6 ] [ -i Suffix ] [ -F s|S ] [-p N] [ -r ] -V 1|2c|3 ( -C snmp-community | -A “AuthString” (when use snmp v3, U must give the AuthString)) -H host [ -L ] (-I interface|-N interface name) -w in,out-warning-value -c in,out-critical-value -K/M -B/b
Options:
-h (help)
Get the help message
-v (verbose)
Verbose mode, to debug some messages out to the /tmp directory with log file name check_traffic.$$.
-V (snmp version, protocol=[1|2c|3])
Specify the version of snmp
-C (community)
Specify the Community
-H (host)
Specify the host
-6 (use 64 bit)
Use 64 bit counter, ifHC* instead of if*.
-r (range)
Use Range instead of single value in warning and critical Threshold
-I (ifIndex of interface)
Specify ifIndex of each interface
-N (interface name)
Specify the interface name
-L (list)
List all Interfaces on specify host
-B/b (Bps/bps)
Switch to Bps(B/s) or bps(b/s), default is -b, bps
-K/M (kilo/mega)
Switch to K (kilo) or M (mega) Bps|bps, default is -K
-w (warning)
Set inbound and outbound warning threshold for traffic usage or traffic jitter value
-c (critical)
Set inbound and outbound critical threshold for traffic usage or traffic jitter value
-F (format, type=[s|S])
-F s (simple output format)
-F S (simpler output format)
-p (amount of traffic usage records preserved for comparison=INTEGER)
This option is the amount of traffic usage records preserved prior to current traffic usage check. The average of all these preserved values is compared with current check value to detect whether jitter happens. The value (amount) between 4 and 12 is suggested.
-i (suffix=STRING)
It’s the individual suffix added to the CF/STAT_HIST_DATA if necessary.
Current Version
1.3.11
Last Release Date
2013-10-09
Compatible With
- Nagios 1.x
- Nagios 2.x
- Nagios 3.x
- Nagios XI
- Nagios Fusion
Owner
Website
License
GPL
Project Files
File | Description |
---|---|
ct_test.sh |
Project Notes
I recently encounter problems when I monitored interface on Ubuntu 16. I checked and found the script used IF-MIB::ifDescr OID to look and query the interface name, which does not work for Ubuntu 16.
I guess it is a long runing bug or bad usage on this OID as there is a dedicated OID just for name: IF-MIB::ifName. after fixing it ubuntu 16 interfaces are monitored too so as the others that used to work with the previous OID. just replace the OID in the script.
FYI,
David
Got it.
Thanks very much.
./check_traffic.sh -V 1 -C nocgnr -H 172.16.1.105 -L
List Interface for host 172.16.1.105.
Interface index 1 orresponding to Software Loopback Interface 1.
Interface index 2 orresponding to WAN Miniport (SSTP).
Interface index 3 orresponding to WAN Miniport (L2TP).
Interface index 4 orresponding to WAN Miniport (PPTP).
Interface index 5 orresponding to WAN Miniport (PPPOE).
Interface index 6 orresponding to WAN Miniport (IPv6).
Interface index 7 orresponding to WAN Miniport (Network Monitor).
Interface index 8 orresponding to WAN Miniport (IP).
Interface index 9 orresponding to RAS Async Adapter.
Interface index 10 orresponding to WAN Miniport (IKEv2).
Interface index 11 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128.
Interface index 12 orresponding to Microsoft ISATAP Adapter.
Interface index 13 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131.
Interface index 14 orresponding to Microsoft ISATAP Adapter #2.
Interface index 15 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130.
Interface index 16 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135.
Interface index 17 orresponding to Microsoft ISATAP Adapter #3.
Interface index 18 orresponding to Microsoft ISATAP Adapter #4.
Interface index 19 orresponding to Microsoft 6to4 Adapter.
Interface index 20 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 21 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-QoS Packet Scheduler-0000.
Interface index 22 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-WFP LightWeight Filter-0000.
Interface index 23 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-QoS Packet Scheduler-0000.
Interface index 24 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #131-WFP LightWeight Filter-0000.
Interface index 25 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 26 orresponding to WAN Miniport (Network Monitor)-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 27 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-QoS Packet Scheduler-0000.
Interface index 28 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #130-WFP LightWeight Filter-0000.
Interface index 29 orresponding to WAN Miniport (IPv6)-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 30 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 31 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-QoS Packet Scheduler-0000.
Interface index 32 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #135-WFP LightWeight Filter-0000.
Interface index 33 orresponding to WAN Miniport (Network Monitor)-QoS Packet Scheduler-0000.
Interface index 34 orresponding to QLogic BCM57840 10 Gigabit Ethernet (NDIS VBD Client) #128-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 35 orresponding to WAN Miniport (IP)-QoS Packet Scheduler-0000.
Interface index 36 orresponding to WAN Miniport (IP)-Trend Micro NDIS 6.0 Filter driver-0000.
Interface index 37 orresponding to WAN Miniport (IPv6)-QoS Packet Scheduler-0000.
But, don't know which "Interface Index" I need to mention in command line to generate output.
The error is,
./check_traffic.sh -V 1 -C nocgnr -H 172.16.1.105 -N "Interface index 20"
Can not get the interface index with Interface index 20 at 172.16.1.105.
Same error for Linux OS. Please see below.
#########################
./check_traffic.sh -V 1 -C public -H 172.16.1.73 -L
List Interface for host 172.16.1.73.
Interface index 1 orresponding to lo
Interface index 2 orresponding to enP4p1s0f0
Interface index 3 orresponding to enP4p1s0f1
Interface index 4 orresponding to eth1
Interface index 5 orresponding to eth2
Interface index 6 orresponding to virbr0
Interface index 7 orresponding to virbr0-nic
#########################
Please Guide.
Nishith N.Vyas
./check_traffic.sh -V 1 -C nocgnr -H 172.16.1.105 -I 2,
or
./check_traffic.sh -V 1 -C nocgnr -H 172.16.1.105 -N eth0
You can get the full usage at: https://github.com/cloved/check_traffic/blob/master/README.md
Add a Review
You must be logged in to submit a review.
Thank you for your review!
Your review has been submitted and is pending approval.
Recommend
To:
From:
Thank you for your recommendation!
Your recommendation has been sent.