Sometimes you want to monitor bandwidth. Maybe you have 500Mbit wan line between offices and want to make sure what actual performance you get. This can be done with Iperf. However Iperf will just give you the info of just this moment. Maybe you want some more details. There is a simple way of doing this in Check MK.
Start by downloading Iperf on your computer. In my case Windows. Use Iperf2.
https://iperf.fr/iperf-download.php
Place this on your computer like c:\iperf2 so we can use this for a test later.
Now log in to your Linux computer that should be monitored.
Install with
sudo apt-get install iperf
Autostart in Linux:
sudo touch /etc/init.d/iperf sudo chmod +x /etc/init.d/iperf sudo vi /etc/init.d/iperf
#!/bin/bash /usr/bin/iperf -s &
sudo update-rc.d iperf defaults
Now your Linux client should be ok. For a Windows server just place the iperf2 on the server and run “iperf.exe -s”. You may want to use the scheduler to autostart it after reboot.
Now test from your computer to run “iperf.exe -c clientip”
If you get a reply it is up and running.
Next step is to install it on Check MK. First download the scipt here
Place it on your server in “omd/sites/mysite/lib/nagios/plugins/”
In WATO create a rule like this. There is another classic Nagios script without perf counters and that is why I camm mine 2 in the end. Choose what servers to apply this on.
Also create a “Normal check interval for service checks” with the service Iperf$. You do not want to run this every minute. I run it one every hour.
I created a service group for Iperf and can get the results like this. I also get nice graphs now.
Hi, thank you for this beautiful work! I have applied the steps of this tutorial, but my check_mk says: (null) in field “status detail”
I have tried to troubleshoot this, but i can’t find no solutions.
Do you have a suggestion for me?
Thanx
Lor
Hi! I just upgraded mu CMK from p15 to p20 and got a similar error that you have. I solved it by using this commandline instead:
/omd/sites/white/lib/nagios/plugins/./check_iperf2.pl $HOSTADDRESS$ 30 40
Kake sure the plugin is here. Also make sure it has the correct chmod/chown. Like chown root:root and chmod 755 or something.
let me know if this works.