Unable to apply configuration.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Here's the output:

[root@nagios init.d]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
............................................
PROCESSED 0 COMMANDS
ESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-08-28 11:53:51-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

0K .......... . 809M=0s

2015-08-28 11:53:52 (809 MB/s) - `nagiosql.login' saved [11691]

/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&username=nagiosxi&password=sra5to' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
SETUID ROOT OK
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-08-28 11:53:52-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

0K .......... . 786M=0s

2015-08-28 11:53:53 (786 MB/s) - `nagiosql.login' saved [11691]

/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&username=nagiosxi&password=sra5to' -O nagiosql.loginLOGIN 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 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-08-28 11:53:53-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.export.monitoring'

0K .......... .... 1.12G=0s

2015-08-28 11:53:54 (1.12 GB/s) - `nagiosql.export.monitoring' saved [14751]

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.0.7
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 06-03-2014
License: GPL

Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 385 services.
Checked 144 hosts.
Checked 11 host groups.
Checked 8 service groups.
Checked 13 contacts.
Checked 7 contact groups.
Checked 125 commands.
Checked 20 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 144 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 20 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
/etc/init.d/nagios: line 209: /dev/null: Permission denied
Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.
OUTPUT=Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.
RETURNCODE=6
........
PROCESSED 1 COMMANDS
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Unable to apply configuration.

Post by ssax »

Don't apply configuration or anything in between, when an apply config fails it reverts the files back to a known working state, we want to keep the files in a bad state.

First go to Configure > Core Config Manager > Tools > Write Config Files
- Click Delete (don't worry, it's safe, they get re-written)
- Click Write

Run this command and post the full output:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Then zip up your /usr/local/nagios/etc directory and attach it here.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Output:

Nagios Core 4.0.7
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 06-03-2014
License: GPL

Website: http://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 385 services.
Checked 144 hosts.
Checked 11 host groups.
Checked 8 service groups.
Checked 13 contacts.
Checked 7 contact groups.
Checked 125 commands.
Checked 20 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 144 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 20 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
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Unable to apply configuration.

Post by Box293 »

Can you upload the file:
/etc/sudoers
Also, any files in /etc/sudoers.d/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Attached is contents of sudoers file.
No /etc/sudoers.d directory exists.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to apply configuration.

Post by lmiltchev »

The sudoers looks fine.
/etc/init.d/nagios: line 209: /dev/null: Permission denied
What are the permissions on "/dev/null"?

Code: Select all

ll /dev/null
Be sure to check out our Knowledgebase for helpful articles and solutions!
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

crw-r----- 1 mysql mysql 1, 3 Aug 28 10:04 /dev/null
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Unable to apply configuration.

Post by ssax »

Try this:

Code: Select all

chmod 666 /dev/null
chown root.root /dev/null
Then:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Apply config and send us the full output.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Which output do you want? What was displayed while the tail -f was going?

The configuration applied this time, and everything under the "System Ok" is green again.

I'll attach the profile if there is anything else you need to check on.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to apply configuration.

Post by tgriep »

Is everything working now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked