Network Connections, Stats and Bandwidth

check_eth

Description:

This plugins monitor realtime traffic on linux server interface on any distribution centos,redhat,debian etc . In old version by joseph stats are calculated wrong way not realtime but after my changes it will monitor your stats realtime transfer rate of interface.
Steps: apply this plugin like this
—————————————————
./check_eth -i eth0 -w 1024K Bps -c 2048K Bps
where i=interface
-w=Warning can be defined in KB,MB etc like (-w 1024K Bps or -w 1M Bps)
-c =Critical can be defined in KB,MB etc like (-c 2048K Bps or -c 2M Bps)
2.also # cd /tmp
# ls -lha | grep traffic
there is file name traffic-eth0 or traffic-eth1 according to your interface
change its permission as per your nrpe user like
chown nagios:nagios traffic-eth0 or if nrpe user is nrpe then chown nrpe:nrpe traffic-eth0 so that nrpe have write permission on it.

Result:after that apply as per in your nrpe.cfg on remote and cheers you will get realtime traffic rate on nagios 🙂

#./check_eth -i eth0 -w 1024K Bps -c 2048K Bps
Traffic on eth0 : RX Bytes: 1TB, TX Bytes: 3TB: RX Speed: 129KBps, TX Speed: 248KBps: OK bandwidth utilization

#### for commands.cfg if you want to monitor nagios interface traffic
## vim /usr/local/nagios/etc/objects/commands.cfg then add
# ‘check_eth’ command definition
define command{
command_name check_eth
command_line $USER1$/check_eth -i eth0 -w 1024K Bps -c 2048K Bps
}

### after that in nagios service monitoring file add like this.
define service{
use local-service ; Name of service template to use
host_name NMS
service_description Interface Eth0
check_command check_eth
}

## after adding restart nagios service after verification command.
Thanks

Current Version

1.2

Last Release Date

2016-10-20

Compatible With

  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI

Owner

License

GPL


Project Files
Project Photos
Project Notes
check_eth
Reviews (5) Add a Review
(Return code of 127 is out of bounds. Check if plugin exists)
by GGG, March 31, 2020

Hello, I have completed all the steps which worked wonderfully.But, i am getting error mentioned in the title Please Help!!! (Return code of 127 is out of bounds. Check if plugin exists)



ownership of tmpfile is important
by andyspiegl, October 31, 2017

Thanks for the check script. The only thing I fell for was that the nagios user needs write permissions for the tmpfile. Initially I tried the check script manually which created the tmpfile with owner "root". All following calls of the script failed to write the interface state to the tmpfile (silently!) which led to strange speed values and a very flat PNP curve. :-) I suggest to add the following lines: if ( open( TMP, ">$tmpfile-$iface" ) ) { print( TMP "$data{time}:$data{rxbytes}:$data{txbytes} " ); close( TMP ); } + else + { + print "ERROR: Unable to write $tmpfile-$iface "; + exit $status{UNKNOWN}; + } Andy



nagiosgraph
by rvasten, October 31, 2017

The plugin is real good, I also like to know how to get the graphs in Nagiosgraph, as for now I only see the alerts Thanks



Great plugin!
by soad1982, July 31, 2017

It's great, I can now have control over the bandwidth my servers are using, I just have one question, how did you get the graphs the screenshots? I only have alerts then but does not show a history with the interface usage. Thanks!



Really nice!
by brianjcollins, October 31, 2016

Exactly what I was looking for! I did have to make a minor adjustment for the script to work. I had to disable using the embedded perl interpreter ("# nagios: -epn" added after the perl statement in the script), but once I did the script returned the result that was expected. Some further instructions for new comers to Nagios would probably be helpful as well. IE, instructing the user to add it to commands.cfg and their remote servers, etc... Thanks



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.

Project Stats
Rating
4.7 (7)
Favorites
3
Views
32,644