Page 1 of 4

Monitoring Network Bandwidth

Posted: Wed Mar 15, 2017 1:20 pm
by youssef chtourou
Good Afternoon ladies and gentlemen :D :D

I'am a Beginner in Administration of Nagios XI :cry: :cry: :cry:

i'ask , it is possible to monitoring a network bandwith. In fact , View each user connected in The network , what is doing , what his pourcentage in network bandwidth , ... ;)

Thank YOU very munch :D

Re: Monitoring Network Bandwidth

Posted: Wed Mar 15, 2017 2:09 pm
by tmcdonald
That's a bit granular for XI, but Nagios Network Analyzer might be more help. The problem is that at the network layer there is really no concept of a "user" so you need to do packet inspection. NNA is not currently able to do packet inspection, but you can look at traffic source and destination IP and port.

Re: Monitoring Network Bandwidth

Posted: Thu Mar 16, 2017 2:43 am
by youssef chtourou
Thank You very munch , Sir :D :D

Tell me , it is possible to look at traffic source and destination IP and port with Nagios ? If Yes , HOW ? :oops: :oops:

Thank you and Sorry for any disturbance :idea: :idea:

Re: Monitoring Network Bandwidth

Posted: Thu Mar 16, 2017 3:11 pm
by mcapra
As tmcdonald pointed out, Nagios Network Analyzer was designed more for that purpose.

Take a look over this overview video and see if that's something that would work for you:
https://www.youtube.com/watch?v=uk7tbV5VQwc

Re: Monitoring Network Bandwidth

Posted: Mon Mar 20, 2017 1:48 pm
by rhonorio
What if I just want to know the traffic through the interfaces of a Cisco Router (model WS-C3650-24TS) that I've already added as a host? It shows 0Mbps for all the interfaces.
Do I need to do anything else apart from adding the router as a host?

Thanks in advance!

Re: Monitoring Network Bandwidth

Posted: Mon Mar 20, 2017 2:10 pm
by rkennedy
Did you run through a wizard to set it up?

The other option is using the snmpwalk wizard, and specifying the OID that maps to how much traffic has gone through x int.

Re: Monitoring Network Bandwidth

Posted: Mon Mar 20, 2017 2:25 pm
by dwhitfield
If @rkennedy's suggestion doesn't prove fruitful for you, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the Download Profile button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info).

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

Re: Monitoring Network Bandwidth

Posted: Mon Mar 20, 2017 2:41 pm
by rhonorio
Please find attached my profile.
I did use the Wizard to add the host but it didn't work. I tried the snmpwalk wizard, but I'm not sure what OID I should use. I'll research about that and let you know.

Re: Monitoring Network Bandwidth

Posted: Mon Mar 20, 2017 2:55 pm
by rhonorio
I used the OID 1.3.6.1.2.1.31.1.1.1.6 (which is ifHCInOctets) and it shows me a list of ALL the interfaces...kind of tedious to add them one by one, but it's ok anyways. That would work but only if I can add a multiplier for every interface (as this OID gives me octets, not the bytes). Can I do that?

Re: Monitoring Network Bandwidth

Posted: Tue Mar 21, 2017 12:11 pm
by dwhitfield
You'll need to write your own plugin. I think the following will be helpful. It doesn't do what you want it to do, but it should give you clues.

Code: Select all

#!/bin/bash
inbound_temp="$(/usr/local/nagios/libexec/check_snmp $4 -C public -o 1.3.6.1.2.1.2.2.1.10.15)"
#inbound_temp="SNMP OK - 3788642629 | iso.3.6.1.2.1.2.2.1.10.15=3788642629c"
outbound_temp="$(/usr/local/nagios/libexec/check_snmp $4 -C public -o 1.3.6.1.2.1.2.2.1.16.15)"
#outbound_temp="SNMP OK - 4243923118 | iso.3.6.1.2.1.2.2.1.16.15=4243923118c"
inbound=`echo $inbound_temp|grep -oP '(?<=\-)(.*?)(?=\|)'`
outbound=`echo $outbound_temp |grep -oP '(?<=\-)(.*?)(?=\|)'`
### Perform Logic here
inbound_per=$(echo $inbound  $1|awk '{ print $1/$2*100 }')
inbound_per=`printf %.0f $inbound_per`
outbound_per=$(echo $outbound  $1|awk '{ print $1/$2*100 }')
outbound_per=`printf %.0f $outbound_per`
total=$(( $inbound_per + $outbound_per ))

#echo "Inbound Percent = $inbound_per"
#echo "Outbound Percent = $outbound_per"
#echo "Total Percent = $total"

perfdata="| 'total'=$total%;$2;$3;0;100 'inbound'=$inbound_per%;;;0;100 'outbound'=$outbound_per%;;;0;100"

if [ "$total" -ge "$3" ];then
        echo "CRITICAL - Total traffic above threshold - $total $perfdata"
        exit 2
elif [ "$total" -ge "$2" ];then
        echo "WARNING - Total traffic above threshold - $total $perfdata"
        exit 1
else
        echo "OK - Traffic at good percentage $perfdata"
        exit 0
fi
You can find the context for this script at https://support.nagios.com/forum/viewto ... 16&t=33722 (it is specifically about Cisco routers, so I hope it is *very* helpful, but I don't have anything to test against here)