Page 1 of 1

snmp community changed no longer logging switch bandwidth

Posted: Tue Jun 30, 2020 4:18 pm
by lilydalehs
Hi All,

the community string on a number of our switches was recently changed (from the default public to something else) and now the services that were logging the bandwidth through ports on the switch is no longer getting any data.

I was able to change the community string on the services that were checking the status of those ports, as the community string was one of the arguments. However, the check bandwidth service didn't have the community string listed. The service is still polling, but returns a zero value.

How do I get this service to update with the new community string?

Regards,
Chris.

P.S. We're running version 5.2.5

Re: snmp community changed no longer logging switch bandwidt

Posted: Tue Jun 30, 2020 4:43 pm
by tgriep
On the Nagios server, there is a application called MRTG that gathers the bandwidth data from the devices that is used with the check_rrdtraf plugin.
The MRTG process has it's own configuration files and they would have to be edited as well to update the community string.

The configuration files are in the /etc/mrtg/conf.d folder and they are named with the IP Address of the device you are monitoring.
Edit those files and after the change, the bandwidth should start up again after 20 minutes or so.

You might be able to recreate the files quickly and here is how to do that.
If you open up one of the /etc/mrtg/conf.d file you may see a line like the following example.

Code: Select all

/usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed 100000000 [email protected]:161::::2
That is the command that was used to create the cfg file.
First make a copy of the existing file in to a different folder.

Then run the following command, but replace public with the new community string. Run this from the /etc/mrtg/conf.d folder.

Code: Select all

/usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed 100000000 [email protected]:161::::2 >10.174.64.159.CFG
That will overwrite the file with the new community string and allow MRTG to gather the data for the plugin.

Re: snmp community changed no longer logging switch bandwidt

Posted: Wed Jul 01, 2020 4:26 pm
by lilydalehs
Hi tgriep,

many thanks for the very informative reply. I used that 2nd example you showed above to re-run the configuration file and it worked a treat.

Cheers,
Chris.

Re: snmp community changed no longer logging switch bandwidt

Posted: Wed Jul 01, 2020 4:44 pm
by tgriep
@lilydalehs, Your very welcome, glad to help.