Unable to edit services and hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Unable to edit services and hosts

Post 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?
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Re: Unable to edit services and hosts

Post 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)
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Unable to edit services and hosts

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Re: Unable to edit services and hosts

Post 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?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Unable to edit services and hosts

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Re: Unable to edit services and hosts

Post by hales8181 »

Thanks - I've sent the file across
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Re: Unable to edit services and hosts

Post 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!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Unable to edit services and hosts

Post 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..

Code: Select all

max_allowed_packet=512M
If the error persists, please PM the /usr/local/nagios/var/nagios.log and the /var/log/mysql/mysqld.log files.
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
hales8181
Posts: 33
Joined: Thu Jan 19, 2017 11:15 am

Re: Unable to edit services and hosts

Post by hales8181 »

Thanks Benjamin, I've PM'd you teh logs as I've tried these and I still have the issue.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Unable to edit services and hosts

Post 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:

Code: Select all

systemctl start nagios
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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked