0

Hello

I have a dedicated system for monitoring connected to the network in all remote offices. Our main/nagios server have connection to all. I want to get the bidirectional Bandwidth measurement between the dedicated system and nagios server. Connection should be made with snmp. But without snmp traps and NPRE.

Which tool is recommend for this job? I dont need a graphical output itself since the collected data of bandwidth should be send to muniin for further processing and graphical output. Thank you in advance!

  • I believe nagios has a built in SNMP check tool, check_snmp is the name if I remember correctly. If I'm wrong you can write a bash script and use command line snmp utilities to write your own nagios plugin. The only potential hard part would be finding the right snmp oid depending on what device your trying to monitor. – person Jan 17 '17 at 12:57
  • Like i said I have a mini computer connected to each remote office. Plugged to the router. Check_snmp doesnt check bandwitdth bidirectional itself. – Sanctriell Jan 17 '17 at 14:32

2 Answers2

0

You can use the nagios plugins which contain the script check_netint. This script will calculate the bandwith of an interface from the datas stored in the MIB of your router with SNMP.

Sorcha
  • 1,315
  • 8
  • 11
  • what is the difference betwee iperf and this one actually? I mean know check_netint has even more information and saved in MIB. But I need to for nagios for notification and as well for munin for the rrd – Sanctriell Jan 18 '17 at 09:38
0

I don't think you can easily get bandwidth usage just between two devices very easily via SNMP. You can however use SNMP get the total bandwidth utilized on the NIC or network port.

I don't think there is an OID for bi-directional bandwidth, at least on cisco devices. But there are OIDs for tx and rx. Write a script that checks snmp for those oids (you can call the existing nagios plugin even) and have the script add the two values together and then output the total. Not sure there's an easier way unless your mini computer has a built-in SNMP client for this. If you can write scripts writing nagios plugins are rather trivial and there is lots of documentation on how to do it. Learning how to create you're own plugins is a powerful skillet to have.

Another option may be to utilize some network tools like tcpdump on the main nagios server. x.x.x.x will be the remote mini-computer.

tcpdmp -ietho0 host x.x.x.x > file

then parse said output which should have a bunch of lines like:

 IP 172.17.17.17.ssh > 172.17.17.18.5878: Flags [P.], seq 952944:953232, ack 3521, win 283, length 288

count the size of each packet (length 288) , return the sum in a plugin. It won't be 100% accurate since it'll include IP/Protocol headers and such. But should serve your purpose.

Useful links:

https://supportforums.cisco.com/discussion/11018931/need-oid-rxload-and-input-rate http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html

Writting plugins:

https://exchange.nagios.org/directory/Tutorials/Other-Tutorials-And-HOWTOs/How-To-Create-a-Nagios-Plugin-Using-Bash-Script/details

person
  • 397
  • 1
  • 2
  • 10
  • I was thinking that to write my own. Can I just use check-iperf for the information I need? But do I need NPRE for that? – Sanctriell Jan 18 '17 at 09:36
  • I just looked at that plugin and it depends on an "iperf" executable. Iperf appears to be another client that needs to be on the remote machine. Ive tried in the past and failed but WMI may help you out here. Or if you find some way to get information on thd cmd locally, you can write an expect script and telnet/ssh into the remote machine and run that command – person Jan 18 '17 at 11:02