Page 1 of 1

Switch ports and bandwidth errors after switch wizard

Posted: Fri Dec 21, 2018 12:02 pm
by gixxx11
I tried to configure some switches using the wizard and it's not working. The port status does report if the port is up or down correctly, but the Bandwidth has one of two issues, either it reports zero up and zero down at all time:

Code: Select all

OK - Current BW in: 0Mbps Out: 0Mbps
Or it says some variation of:

Code: Select all

/var/lib/mrtg/192.168.2.182_139.rrd does not exist.
Reading online I also did the following. I tried "LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg" this is the output:

Code: Select all

[root@nagios /]# LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
ERROR: Line 71 (Target[192.168.2.182_2]: 2:[email protected]:161::::2) in CFG file (/etc/mrtg/conf.d/192.168.2.182.cfg)
contains a duplicate definition for target[192.168.2.182_2].
First definition is on line 4

I tried modifying permissions with:

Code: Select all

chown -R apache.nagios /etc/mrtg/conf.d
chmod -R 775 /etc/mrtg/conf.d
I set up a brand new Nagios XI installation without this switch, and restored from backup, and then recreated the switch but that just recreated the problem.

Thanks for your assistance.

Re: Switch ports and bandwidth errors after switch wizard

Posted: Fri Dec 21, 2018 1:38 pm
by tgriep
When ever a duplicate entry is created in the MRTG configs, the MRTG process will not run until the duplicate is removed.
Removing the duplicated MRTG entry is a manual process and to do this, login to the server as root and run the following commands.

Code: Select all

cd /etc/mrtg/conf.d
grep 192.168.2.182_2 *
That will display the files that entry is in. Remove one of then and try running the MRTG command again to see id there are anymore duplicates.
In so, remove them until it passes and then the bandwidth information should start to work after 15 minutes.

One cause of this is to run the wizard against the same device twice using the IP address one time and the hostname the second time.