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.
Cannot add switch using wizard - error
Re: Cannot add switch using wizard - error
Version: Nagios XI 5.6.10
Red Hat Enterprise Linux Server release 7.7 (Maipo)
64-bit
Manual Install
No special configurations
Red Hat Enterprise Linux Server release 7.7 (Maipo)
64-bit
Manual Install
No special configurations
Re: Cannot add switch using wizard - error
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.
Then increase the PHP settings on the XI server by following this procedure.
Edit the /etc/php.ini file and change the following from
to
add this to the bottom of that file (If it exists, increase it)
Save the file
Then edit this file
add this to the bottom of that file
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.
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/* /rootThen 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 = 128MCode: Select all
max_execution_time = 120
max_input_time = 240
memory_limit = 2048MCode: Select all
max_input_vars=100000Then edit this file
Code: Select all
/etc/httpd/conf/httpd.confCode: Select all
LimitRequestLine 100000service 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!
Re: Cannot add switch using wizard - error
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).
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).
Re: Cannot add switch using wizard - error
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):
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:
- 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.logIf 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/etcRe: Cannot add switch using wizard - error
It looks like this worked, thank you!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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Cannot add switch using wizard - error
Great!chud wrote:It looks like this worked, thank you!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.
Locking thread