Page 2 of 3

Re: Unable to apply configuration.

Posted: Fri Aug 28, 2015 1:56 pm
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

Re: Unable to apply configuration.

Posted: Fri Aug 28, 2015 2:03 pm
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.

Re: Unable to apply configuration.

Posted: Fri Aug 28, 2015 4:26 pm
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

Re: Unable to apply configuration.

Posted: Sun Aug 30, 2015 7:00 pm
by Box293
Can you upload the file:
/etc/sudoers
Also, any files in /etc/sudoers.d/

Re: Unable to apply configuration.

Posted: Mon Aug 31, 2015 1:53 pm
by mccollege
Attached is contents of sudoers file.
No /etc/sudoers.d directory exists.

Re: Unable to apply configuration.

Posted: Mon Aug 31, 2015 4:11 pm
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

Re: Unable to apply configuration.

Posted: Mon Aug 31, 2015 4:16 pm
by mccollege
crw-r----- 1 mysql mysql 1, 3 Aug 28 10:04 /dev/null

Re: Unable to apply configuration.

Posted: Mon Aug 31, 2015 4:27 pm
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.

Re: Unable to apply configuration.

Posted: Mon Aug 31, 2015 4:56 pm
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.

Re: Unable to apply configuration.

Posted: Tue Sep 01, 2015 8:54 am
by tgriep
Is everything working now?