Nagios config snapshots acting strange

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios config snapshots acting strange

Post by tgriep »

With the time issue you were having, it could of left the reconfigure lock file so delete it first by running the following.

Code: Select all

rm /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
Then run the procedure from the previous post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

Got a result from that! Here's the output:

URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=*password*nagiosql.login--2018-11-07 13:14:20-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

[ <=> ] 39,254 --.-K/s in 0.01s

2018-11-07 13:14:42 (2.50 MB/s) - ‘nagiosql.login’ saved [39254]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=*password* nagiosql.login--2018-11-07 13:14:43-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

[ <=> ] 39,254 --.-K/s in 0.01s

2018-11-07 13:14:44 (2.62 MB/s) - ‘nagiosql.login’ saved [39254]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-11-07 13:14:44-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2018-11-07 13:15:20 ERROR 500: Internal Server Error.

NAGIOSQL WRITE CONFIGS FAILED!\n
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

I did try to rewrite the configs using the config file management tab in the UI, but it failed.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

Interestingly, I ran the same commands after that to get back to where we are now, and everything came back normal....
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

What it looks like, and if I'm wrong correct me, but after I deleted the config files in the Config File Management tab, the reconfigure script rewrote them upon running. Seems to have corrected all the problems and conflicts we were having.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios config snapshots acting strange

Post by tgriep »

Yes, you are correct, the reconfigure script will export the objects in the Core Config Manager and write them to the flat files.
If the new copies do not have any conflicts, then the Apply Config should work.

But this error from your previous post.
HTTP request sent, awaiting response... 500 Internal Server Error
2018-11-07 13:15:20 ERROR 500: Internal Server Error.

NAGIOSQL WRITE CONFIGS FAILED!\n

Is a problem that needs to be looked at.

Run through the reconfigure script procedure and it you see that error, check the Apache Error logs on why it is generating the 500 Intername server errorl.
Look at

Code: Select all

/var/log/httpd/error_log
or

Code: Select all

/var/log/httpd/ssl_error_log
Be sure to check out our Knowledgebase for helpful articles and solutions!
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

The successful one, or the failed one? Sorry to ask, but I think I only saw it in the failed one so I wanted to make sure that's what you're asking for.

Edit: Or did you want me to run the reconfigure procedure one more time?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios config snapshots acting strange

Post by tgriep »

Yes, I want you to run the reconfigure script again and see if you get the 500 error again.
Be sure to check out our Knowledgebase for helpful articles and solutions!
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: Nagios config snapshots acting strange

Post by andrewatmacys »

Here's the output, seems like we might be good to go!

-bash-4.2$ ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=*password* -O nagiosql.login--2018-11-07 15:35:27-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'nagiosql.login'

[ <=> ] 37,964 --.-K/s in 0.01s

2018-11-07 15:35:30 (2.53 MB/s) - 'nagiosql.login' saved [37964]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=*password* -O nagiosql.login--2018-11-07 15:36:24-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'nagiosql.login'

[ <=> ] 37,964 --.-K/s in 0.01s

2018-11-07 15:36:24 (2.57 MB/s) - 'nagiosql.login' saved [37964]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-11-07 15:36:24-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'nagiosql.export.monitoring'

[ <=> ] 21,399 --.-K/s in 0.01s

2018-11-07 15:36:31 (1.67 MB/s) - 'nagiosql.export.monitoring' saved [21399]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
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...
Checked 12 services.
Checked 9083 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 7 contacts.
Checked 2 contact groups.
Checked 126 commands.
Checked 13 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 9083 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 13 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios config snapshots acting strange

Post by tgriep »

Yes it does look good. Try the Apply Config and if it passes, you should be good.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked