Page 1 of 1

Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Tue Apr 06, 2021 10:48 am
by amoss24
Hello Nagios community,

I am reaching out to see if anyone else has experienced certain models of network gear not working right when setting up a device using the Network Switch/Router wizard. I have run through the wizard with an ASR 1001x and it is able to recognize the interfaces with the right info, but after completing the wizard, the bandwidth values returned are never more than 0 for both in and out:

Example output:

Code: Select all

[nagios@nagios ~]$ /usr/local/nagios/libexec/check_rrdtraf -f /var/lib/mrtg/10.255.254.201_3.rrd -w 800.0,800.0 -c 900.0,900.0 -l M
OK - Current BW in: 0Mbps Out: 0Mbps|in=0Mb/s;800.0;900.0 out=0Mb/s;800.0;900.0
I was able to find this plugin:
https://exchange.nagios.org/directory/P ... th/details

and it seems to do the job fairly well, but just wondering if anyone else has encountered the same issue trying to use the wizard.

Thank you in advance!

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Wed Apr 07, 2021 9:50 am
by benjaminsmith
Hi,

Glad to see you've found a workaround. After looking into this further, this can be caused by incorrect permissions on the files the MRTG process is using to gather the bandwidth information. Run the following commands, then wait for 20 minutes and let me know if this resolves the issue.

Code: Select all

chown apache:nagios /etc/mrtg -R
chmod 775 /etc/mrtg -R
chown apache:nagios /var/lib/mrtg -R
chmod 775 /var/lib/mrtg -R
If that doesn't resolve it, please run the following commands and attach the mrtg.txt file to the thread and send us a system profile to help diagnose the issue. Thanks, Benjamin

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -debug=cfg,base,log &> /tmp/mrtg.txt
LANG=C LC_ALL=C /usr/bin/mrtg &>> /tmp/mrtg.txt
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios &>> /tmp/mrtg.txt
{ time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg 2>1 ; } 2>> /tmp/mrtg.txt
To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Fri Apr 09, 2021 3:08 pm
by amoss24
Thank you, @benjaminsmith

I tried changing the permissions but the issue did not resolve itself.

Would you prefer the mrtg.txt file in a PM? It does have things like our snmp strings in it. The file is also quite large. I opened it in Visual Studio Code as it is 46mb.

I likely do not have a good understanding of MRTG but I glanced through the file and I'm seeing some entries like this:

Code: Select all

--base: Act on Router/Target 10.255.254.201_3
--base: Get Current values: in:820270688718241, out:128384501380253, up:undef, name:undef, time:1617995327
--base: Create Graphics
--base: start RRDtool section
--base: maxi:125000000, maxo:125000000
--log: RRDs::update(/var/lib/mrtg/10.255.254.201_3.rrd, '1617995327:820270688718241:128384501380253')
--log:  got: ???/???
--base: Check for Thresholds
I'm thinking getting ???/??? might have something to do with why the output is always 0.

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Fri Apr 09, 2021 4:43 pm
by benjaminsmith
Hi,
Would you prefer the mrtg.txt file in a PM? It does have things like our snmp strings in it. The file is also quite large. I opened it in Visual Studio Code as it is 46mb.
If you could send in a PM that would be great. It's a text file, so try compressing into a zip file, that should reduce the size considerably. Thanks, Benjamin

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Tue Apr 13, 2021 3:59 pm
by benjaminsmith
Hi,

Thanks for sending over the files. After some research on this and getting some input from the team here, the main issue is that it's taking too long for the MRTG process to finish (over 5 minutes). Please go through the following steps to help resolve this.

1. There are a lot of devices in the MRTG folder that no longer exists on the CCM. Go to the following directory and delete the older cfg files that are not being updated and no longer exist in your monitoring environment.

Code: Select all

/etc/mrtg/conf.d
2. Since rrdcache was installed, comment out the following line in /etc/mrtg/mrtg.cfg.

Code: Select all

LibAdd: /opt/rrdtool-1.4.4/lib/perl/5.16.3
3. Re-install the rrdtool-perl, since this is removed by rrdcache.

Code: Select all

yum install rrdtool-perl
To test it, run the following command as root.

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
If you do not see the "could not find RRDs.pm" message, then MRTG is OK.

4. Edit the /etc/mrtg/mrtg.cfg file and change:
Forks: 4
to
Forks: 16
This setting will spawn 4 times as many processes and should speed up the MRTG process. Wait for 20 to 30 minutes for the changes to take effect, and then check your graphs again. Let us know if they are working.

Regards,
Benjamin

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Fri Apr 16, 2021 10:10 am
by amoss24
Thank you @benjaminsmith,

After going through the steps provided, I started to see real statistics coming in. And after running through the wizard, things work like they should.

Appreciate the help!

Re: Interface Bandwidth Monitoring on Cisco ASR1001X

Posted: Fri Apr 16, 2021 10:30 am
by benjaminsmith
Hi @amoss24,

Your welcome! Glad it's working now.

We'll go ahead and close this post, but feel free to open another if you have any new questions.

Have a great weekend!

Benjamin