Can't apply config, but no error message

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Can't apply config, but no error message

Post by andrewatmacys »

When trying to apply config I get an error with no error message, it's just blank. When I run

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

It returns an all good message. I have a system profile and screenshot of the command being run ready to send in a pm.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't apply config, but no error message

Post by npolovenko »

Hello,@andrewatmacys. In XI web interface please go to Configure -> Core Configurations Manager, then click on Tools -> Config File Management in the left column. Then perform the following actions in order:
1)Write
2)Delete
3)Write
4)Verify

Please copy and paste all the errors that you see in the output.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Can't apply config, but no error message

Post by andrewatmacys »

When I click write, it gives me a HTTP 500 error, delete works fine.

Verify gives the following:

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: There are no services defined!
Checked 0 services.
Checked 2289 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 5 contacts.
Checked 2 contact groups.
Checked 126 commands.
Checked 11 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2289 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 11 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't apply config, but no error message

Post by npolovenko »

@andrewatmacys, Alright, now we have the error message.
Error: There are no services defined!
Can you do the same procedure one more time but when you get this error output run the following command in the console:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
And post the output.

PS: ALso, it may be easier to just revert to a previous working snapshot.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Can't apply config, but no error message

Post by andrewatmacys »

[nagios@server /]$ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: There are no services defined!
Checked 0 services.
Checked 2289 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 5 contacts.
Checked 2 contact groups.
Checked 126 commands.
Checked 11 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2289 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 11 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

Seems to be the same error.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't apply config, but no error message

Post by npolovenko »

@andrewatmacys, Why there aren't any services?
Please run the following script:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
Also, please send in your Nagios XI System Profile so I can review it.
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
Save the profile.zip file and upload it to a cloud storage of your choice. Then share a link with me in a personal message.

After you send a profile please post something in this thread to bring it back up in the support queue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Can't apply config, but no error message

Post by andrewatmacys »

Profile was sent!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't apply config, but no error message

Post by npolovenko »

@andrewatmacys, What happened when you ran the database repair script?

Please restart the apache server:

Code: Select all

service httpd restart
Whats the status of:

Code: Select all

service mysqld status

Code: Select all

service mariadb status

Are you able to sign in to the database?

Code: Select all

mysql -uroot -pnagiosxi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Can't apply config, but no error message

Post by andrewatmacys »

Still having some issues. DB repair said it was successful, but it wasn't fixed. I'm unable to run any of the other commands. Attempted an upgrade of the server, but get this error message:

Backing up MySQL databases...
mysqldump: Got errno 28 on write
Error backing up MySQL database 'nagios' - check the password in this script!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Can't apply config, but no error message

Post by npolovenko »

@andrewatmacys, Right, So what happened when you ran:

Code: Select all

service mysqld status
service mariadb status
Are you able to sign in to the database?

Code: Select all

mysql -uroot -pnagiosxi
I have a feeling that something is going on with the database.

I'm unable to run any of the other commands
Or did all the above commands fail??

Then please run:

Code: Select all

service mysqld start
service mariadb start

Code: Select all

service mysqld status
service mariadb status
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked