Page 2 of 2

Re: Problems to see the bandwidth correctly with mrtg

Posted: Thu Nov 30, 2017 6:39 am
by jorgeinteractivo
the only thing I need is to measure the actual bandwidth of a port on my cisco switch. with any tool but I want to see the real value in mb.

Re: Problems to see the bandwidth correctly with mrtg

Posted: Fri Dec 01, 2017 1:31 pm
by kyang
Could you try using another plugin possibly?

Code: Select all

./check_iftraffic64.pl -H 192.168.5.1 -C xx -i 11
OK - Average IN: 312.00B (0.00%), Average OUT: 312.00B (0.00%)Total RX: 632.12MBytes, Total TX: 632.12MBytes|inUsage=0.00%;85;98 outUsage=0.00%;85;98 inBandwidth=312.00B outBandwidth=312.00B inAbsolut=632117694c outAbsolut=632118802c
Would something like this work for you? It runs MB without passing the -u

Here are the help options that can be displayed in.

Code: Select all

    -u, --units STRING
        g=gigabits/s,m=megabits/s,k=kilobits/s,b=bits/s. Required if -b, -I, -M,
        or -O are used.
https://exchange.nagios.org/directory/P ... 64/details

Re: Problems to see the bandwidth correctly with mrtg

Posted: Mon Dec 04, 2017 7:26 am
by jorgeinteractivo
I recived this message:

[root@localhost libexec]# ./check_iftraffic64.pl -H 172.16.100.190 -C public -i 11
Can't locate Net/DNS.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_iftraffic64.pl line 1016.
BEGIN failed--compilation aborted at ./check_iftraffic64.pl line 1016.

Re: Problems to see the bandwidth correctly with mrtg

Posted: Mon Dec 04, 2017 9:09 am
by jorgeinteractivo
I fixed it, but the result is the same

# ./check_iftraffic64.pl -H 172.16.100.190 -C public -i GigabitEthernet1/0/25
OK - Average IN: 2.12MB (1.70%), Average OUT: 3.98MB (3.18%)Total RX: 4362.42GBytes, Total TX: 12346.77GBytes|inUsage=1.70%;85;98 outUsage=3.18%;85;98 inBandwidth=2122714.00B outBandwidth=3976800.71B inAbsolut=4362419774145c outAbsolut=12346767752801c

Re: Problems to see the bandwidth correctly with mrtg

Posted: Mon Dec 04, 2017 4:20 pm
by tgriep
If you want the check_iftraffic64.pl plugin to display the output in bits per seconf, you would add the -B option to your command.

Code: Select all

-B, --bits FLAG
        Display results in bits per second b/s (default: Bytes/s)
Run the command like this to output the results in bits.

Code: Select all

./check_iftraffic64.pl -H 172.16.100.190 -C public -i GigabitEthernet1/0/25 -B
For a full list of options for that plugin, take a look at this.
Usage: check_iftraffic64.pl -H host [ -C community_string ] [ -i if_index|if_descr ] [ -r ] [ -b if_max_speed_in | -I if_max_speed_in ] [ -O if_max_speed_out ] [ -u ] [ -B ] [ --32bit ] [ -f ] [ -A IP Address ] [ -L ] [ -M ] [ -w warn ] [ -c crit ] [ -v 1|2|3 ] [ --username <username> ] [ --authpassword <authpassword> ] [ --authprotocol MD5|SHA ] [ --privpassword <privpassword> ] [ --privprotocol DES|AES|3DES ]
Example 1: check_iftraffic64.pl -H host1 -C sneaky
Example 2: check_iftraffic64.pl -H host1 -C sneaky -i "Intel Pro" -r -B
Example 3: check_iftraffic64.pl -H host1 -C sneaky -i 5
Example 4: check_iftraffic64.pl -H host1 -C sneaky -i 5 -B -b 100 -u m --32bit
Example 5: check_iftraffic64.pl -H host1 -C sneaky -i 5 -B -I 20 -O 5 -u m
Example 6: check_iftraffic64.pl -H host1 -C sneaky -A 192.168.1.1 -B -b 100 -u m
Example 7: check_iftraffic64.pl -H host1 -C sneaky -A 192.168.1.1 --force --32bit
Example 8: check_iftraffic64.pl -H host1 --username admin --authpassword sneaky
Example 9: check_iftraffic64.pl -H host1 --username admin --authpassword sneaky123 --privpassword reallysneaky --privprotocol 3DES
Options:
-b, --bandwidth INTEGER
-I, --inBandwidth INTEGER
Interface maximum speed in kilo/mega/giga/bits per second. Applied to
both IN and OUT if out (-O) max speed is not provided. Requires -u.
-O, --outBandwidth INTEGER
Interface maximum speed in kilo/mega/giga/bits per second. Applied to
OUT traffic. Uses the same units value given for -b. Requires -u.
-i, --interface STRING
Interface Name
-M, --max INTEGER
Max Counter Value (in bits) of net devices in giga/mega/kilo/bits. Requires -u.
-r, --regexp
Use regexp to match NAME in description OID
-u, --units STRING
g=gigabits/s,m=megabits/s,k=kilobits/s,b=bits/s. Required if -b, -I, -M,
or -O are used.
-A, --address STRING (IP Address)
IP Address to use when determining the interface index to use. Can be
used when the index changes frequently or as in the case of Windows
servers the index is different depending on the NIC installed.
-C, --community STRING
SNMP Community.
-H, --host STRING or IPADDRESS
Check interface on the indicated host.
-c, --critical INTEGER
% of bandwidth usage necessary to result in critical status (default: 98%)
-w, --warning INTEGER
% of bandwidth usage necessary to result in warning status (default: 85%)
--32bit FLAG
Set to use 32 bit counters instead of 64 bit (default: 64 bit).
-B, --bits FLAG
Display results in bits per second b/s (default: Bytes/s)
-f, --force FLAG
Set to force either 64 bit or 32 bit only checking (32 bit requires --32bit flag).
-d, --debug INTEGER
Output some debug info, not supported inside of Nagios but may be useful
from the command line. Levels 1-4 can be specified, 4 being the most information.
-h, --help
Displays this help text
-L, --list FLAG (on/off)
Tell plugin to list available interfaces. This is not supported inside
of Nagios but may be useful from the command line.
-v, --Version STRING
Set SNMP version (defaults to 2). Version 2 or 3 required for 64 bit counters.
--authpassword STRING
Set v3 authorization password.
--authprotocol STRING
Set v3 authorization protocol (default: MD5).
--privpassword STRING
Set v3 privilege (encryption) string.
--privprotocol STRING
Set v3 privilege (encryption) protocol (default: DES).

Re: Problems to see the bandwidth correctly with mrtg

Posted: Tue Dec 12, 2017 1:16 pm
by jorgeinteractivo
It worked perfect. Thank you

Re: Problems to see the bandwidth correctly with mrtg

Posted: Tue Dec 12, 2017 5:02 pm
by tgriep
I am confused, it looks like the output of the plugin is not working.

Re: Problems to see the bandwidth correctly with mrtg

Posted: Wed Dec 13, 2017 6:09 am
by jorgeinteractivo
It worked, I had given an error but I fixed it.

Re: Problems to see the bandwidth correctly with mrtg

Posted: Wed Dec 13, 2017 2:00 pm
by tgriep
Ok, thanks for clearing up the confusion. I'll close and lock the post for you then.