Cannot add switch using wizard - error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
chud
Posts: 36
Joined: Thu Jul 18, 2019 5:51 pm

Cannot add switch using wizard - error

Post by chud »

We are unable to add a switch to Nagios XI, it errors out on the last step when we try to apply the configuration.
My co-worker, who adds switches all the time using the "Network Switch/Router Monitoring Wizard", noticed that it stopped working a couple of days ago.
Today I attempted to add it with him watching me (to see if it was just him, or if it errored for me too), and I got the same error he did.
We are both admins.

The error is pasted below:

Network Switch / Router Monitoring Wizard

Configuration verification failed.

Configuration Error

An error occurred while attempting to apply your configuration to the monitoring engine. Contact your Nagios administrator if this problem persists.
chud
Posts: 36
Joined: Thu Jul 18, 2019 5:51 pm

Re: Cannot add switch using wizard - error

Post by chud »

Version: Nagios XI 5.6.10
Red Hat Enterprise Linux Server release 7.7 (Maipo)
64-bit
Manual Install
No special configurations
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Cannot add switch using wizard - error

Post by tgriep »

The error may be a left over configuration file causing the wizard to not finish saving the changes.

To fix this open a root shell and run the following to remove any files in the import folder which could cause the error.

Code: Select all

mv /usr/local/nagios/etc/import/* /root

Then increase the PHP settings on the XI server by following this procedure.

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 = 2048M
add this to the bottom of that file (If it exists, increase it)

Code: Select all

max_input_vars=100000
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.
service httpd restart
If the above variables have been changed already on the server to values larger than the examples, increase them further.

This is to ensure PHP has enough resources if the switch has a lot of ports.

Login to the GUI and run the wizard again.
Let us know if it works or not.
Be sure to check out our Knowledgebase for helpful articles and solutions!
chud
Posts: 36
Joined: Thu Jul 18, 2019 5:51 pm

Re: Cannot add switch using wizard - error

Post by chud »

Thanks for your reply.
There were no files in /usr/local/nagios/etc/import/ so there was nothing there to move.
I increased the php.ini limits as instructed, and added the line to the Apache config, then restarted it.
However, still getting the same error as before when trying to enter the switch.
Also, my network guy said this is not a big switch, he has entered a bigger one before Wednesday when this stopped working (he didn't tell me until today though).
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Cannot add switch using wizard - error

Post by ssax »

Please go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Then click the Verify Files button, if it verifies properly, please try to Apply Configuration

That alone may fix it.

If it fails again, please run this tail command (run as root and leave it running):

Code: Select all

tail -Fn0 /usr/local/nagiosxi/var/cmdsubsys.log
Then try to apply configuration through the web interface and once it completes/errors send me the full output from the tail command above.

If all that doesn't fix it, do this (in these exact steps):

Go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Once they are done being written (don't do anything in between, don't apply config or anything), run this command and send me the resulting /tmp/NAGIOSBADFILES.zip file:

Code: Select all

zip -r /tmp/NAGIOSBADFILES.zip /usr/local/nagios/etc
chud
Posts: 36
Joined: Thu Jul 18, 2019 5:51 pm

Re: Cannot add switch using wizard - error

Post by chud »

ssax wrote:Please go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Then click the Verify Files button, if it verifies properly, please try to Apply Configuration

That alone may fix it.
It looks like this worked, thank you!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Cannot add switch using wizard - error

Post by scottwilkerson »

chud wrote:
ssax wrote:Please go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Then click the Verify Files button, if it verifies properly, please try to Apply Configuration

That alone may fix it.
It looks like this worked, thank you!
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked