Page 1 of 2
Unable to edit services and hosts
Posted: Fri Mar 05, 2021 2:16 am
by hales8181
We have recently migrated our Nagios box to new hardware, and whilst everything is working as it is, we're having a hard time editing any services or hosts. Migration was by backing up our old box and restoring to a new box.
When we try to copy a service I've found that I get the error:
Error while inserting the data to the database:
Field 'exclude' doesn't have a default value
Whereas trying to edit an existing host or service I get an error that the host is blank or some other field.
Does anyone know where we went wrong and how we can fix it?
Re: Unable to edit services and hosts
Posted: Fri Mar 05, 2021 3:45 am
by hales8181
Actually, I think we have bigger fish to fry - I've noticed this:
component status.png
Although when you click on monitoring engine status it looks okay:
monengstatus.png
When I hover over the 2 failed services I can see Main PID: XXXXXX (code=exited, status=0/SUCCESS)
Re: Unable to edit services and hosts
Posted: Fri Mar 05, 2021 4:45 pm
by benjaminsmith
Hi,
Lets' try to run the database repair script and let me know if you're able to edit files after that. Please log into the CLI and run the following command as root:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.sh
Then check the status dashlets and let me know if the issue is resolved. If not, send us the system profile and we'll take a closer look at the system for you.
To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Thanks!
Benjamin
Re: Unable to edit services and hosts
Posted: Mon Mar 08, 2021 3:37 am
by hales8181
Hi,
I've run the command and it succeeded successfully, but we still have the same issues on system status.
Which portions of the system profile do you need? Can I send it to you directly?
Re: Unable to edit services and hosts
Posted: Mon Mar 08, 2021 4:05 pm
by benjaminsmith
Hi,
You can send it over directly in a PM message. I would prefer to have the entire profile; feel free to redact any sensitive information.
Once you PM the profile, please update this thread so I know it's been sent. Thanks, Benjamin
Re: Unable to edit services and hosts
Posted: Mon Mar 08, 2021 4:36 pm
by hales8181
Thanks - I've sent the file across
Re: Unable to edit services and hosts
Posted: Tue Mar 09, 2021 10:49 am
by hales8181
I'm unsure if you have received it - I'm not sure as it's in outbox rather than sent items and I'm unsure why - can you confirm if it's been received?
Thansk!
Re: Unable to edit services and hosts
Posted: Tue Mar 09, 2021 5:05 pm
by benjaminsmith
Hi,
Thanks. Got the profile. For some reason, the nagios.log and the database log were not included. There are some database connection/timeout issues still on the server after running the repair script.
. <p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
<p><pre>SQL Error [nagiosxi] : MySQL server has gone away</pre></p>
Please follow the steps in the article below to increase the max connections for the database.
Nagios XI - MySQL/MariaDB - Max Connectio
Next, increase the PHP timeouts and defaults.
Nagios XI - Optimizing The PHP Settings File
Next, add the following to the /etc/my.cnf file,restart MySQL and then test once again..
If the error persists, please PM the /usr/local/nagios/var/nagios.log and the /var/log/mysql/mysqld.log files.
Benjamin
Re: Unable to edit services and hosts
Posted: Wed Mar 10, 2021 2:24 am
by hales8181
Thanks Benjamin, I've PM'd you teh logs as I've tried these and I still have the issue.
Re: Unable to edit services and hosts
Posted: Wed Mar 10, 2021 4:21 pm
by benjaminsmith
Hi,
I'm still seeing errors related that should be resolved by increasing the max connections on the database.
/usr/libexec/mysqld: Forcing close of thread 432567 user: 'nagiosxi'.
And I would recommend downgrading the backend database to the previous version. The instructions are below.
### STANDARD DOWNGRADE OF NDO3
Code: Select all
systemctl stop nagios
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.6.14.tar.gz
tar zxf xi-5.6.14.tar.gz
cd /tmp/nagiosxi/subcomponents/ndoutils
./install
systemctl enable ndo2db
Then edit your /usr/local/nagios/etc/nagios.cfg and make sure this line is uncommented:
Code: Select all
broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
Make sure this line is commented:
Code: Select all
#broker_module=/usr/local/nagios/bin/ndo.so /usr/local/nagios/etc/ndo.cfg
Then start the nagios service:
If the issue persists, let's get a support ticket open, so we can get a remote session setup to troubleshoot this further. To open a support ticket, please visit:
https://support.nagios.com/tickets/
Regards,
Benjamin