Adding another switch to IRF stack

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CJIndustries
Posts: 46
Joined: Wed Aug 24, 2016 6:39 am

Adding another switch to IRF stack

Post by CJIndustries »

I just installed another switch to my existing IRF stack. Do I need to remove the old config and run the wizard again to add the new switch config or is there another way?

Thanks.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Adding another switch to IRF stack

Post by lmiltchev »

If this is the same switch (same IP), you could just run the Switch wizard against it, then delete the "old" rrd files for this switch in the /var/lib/mrtg directory - they will get recreated. If this is completely new switch (different IP), you run the Switch wizard against it, the delete the "old" switch host in the CCM (deleting services first).
Be sure to check out our Knowledgebase for helpful articles and solutions!
CJIndustries
Posts: 46
Joined: Wed Aug 24, 2016 6:39 am

Re: Adding another switch to IRF stack

Post by CJIndustries »

I tried to run the wizard again and it just created a duplicate of the device. So then I just deleted the device altogether and removed the mrtg files. Then I tried to re-add it. Now I'm getting "Status: Unknown" with error "/var/lib/mrtg/10.1.254.252_1.rrd does not exist."
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Adding another switch to IRF stack

Post by lmiltchev »

This is normal behavior for about 10 minutes, until the rrd is created. If after 20-30 min you are still getting the same message, you may need to take some additional steps, that are outlined in this document:

https://assets.nagios.com/downloads/nag ... Router.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
CJIndustries
Posts: 46
Joined: Wed Aug 24, 2016 6:39 am

Re: Adding another switch to IRF stack

Post by CJIndustries »

Tried the steps and there is still a problem with MRTG.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Adding another switch to IRF stack

Post by tgriep »

When a switch has a lot of ports, the Switch wizard has to gather so much data, that it overflows some of the default PHP settings on the system and they need to be increased.

To do that, edit the /etc/php.ini file and change the following from

Code: Select all

max_execution_time = 30
max_input_time = 60
memory_limit = 128M
to

Code: Select all

max_execution_time = 120
max_input_time = 240
memory_limit = 1024M
If tha above has already be increased, do it again by doubling them.

add this to the bottom of that file

Code: Select all

max_input_vars=20000
Save the file

Then edit this file

Code: Select all

/etc/httpd/conf/httpd.conf
add this to the bottom of that file

Code: Select all

LimitRequestLine 100000
Save the file and restart Apache for the changes to take affect.

Code: Select all

service httpd restart
Then re-run the wizard to add the new ports.

If after 15 minutes, the new ports are not created, run the following commands as root and post the the /tmp/mrtg.txt file to the post?

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
ps -ef --cols=300 >>/tmp/mrtg.txt
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
CJIndustries
Posts: 46
Joined: Wed Aug 24, 2016 6:39 am

Re: Adding another switch to IRF stack

Post by CJIndustries »

Made the changes and re-added the switch back into Nagios. I got the same results. Uploaded the requested info.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Adding another switch to IRF stack

Post by tgriep »

The configuration file /etc/mrtg/conf.d/10.1.254.252.cfg has an error in it which is preventing the MRTG application from running.
This is the error.
ERROR: Line 26 (3000 Hanover St) in CFG file (/etc/mrtg/conf.d/10.1.254.252.cfg) does not make sense
Take a look at that file and either fix the error if possible or move that file out of that folder and recreate it with the wizard.

If that does not work for you, can you post that file so we can view it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
CJIndustries
Posts: 46
Joined: Wed Aug 24, 2016 6:39 am

Re: Adding another switch to IRF stack

Post by CJIndustries »

I fixed the problem by commenting out the address in the file. I ran the commands and put them in a text file like before. I have re-added this switch four time now. Every time I try to fix this, I end up going down a rabbit hole which breaks everything. I've restored this server from the last good backup four times.

I really don't know what to do next. Just about ready to open a support ticket.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Adding another switch to IRF stack

Post by tgriep »

Do you still have a copy of the bad MRTG config file so we can look at it?

Code: Select all

10.1.254.252.cfg
It maybe a strange character that is returned when the switch is polled and that is causing the configuration error.

One thing, make sure you are running the latest version of the wizard.
To update it, login to the XI GUI and go to the Admin > Manage Config Wizards menu, Click on the Check for Updates button and update the Wizard if needed.
Also, post the version number of the Wizard as well as the version of XI that you are running.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked