Page 1 of 2
Apply config failing
Posted: Thu Mar 05, 2015 1:16 pm
by BanditBBS
On my dev server which is 2014r2.6 I am applying a config change for the first time after upgrading and get this page:
Capture.PNG
I can't figure it out...that files doesn't exist nor does any config in ccm with that name.
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:19 pm
by tmcdonald
Code: Select all
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh | tail -20
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:22 pm
by BanditBBS
That runs fine...its just the apply changes in the gui causing the problem.
Code: Select all
[root@iss-chi-nag01 scripts]# /usr/local/nagiosxi/scripts/reconfigure_nagios.sh | tail -20
--2015-03-05 12:27:30-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
[ <=> ] 11,827 --.-K/s in 0.02s
2015-03-05 12:27:30 (499 KB/s) - “nagiosql.login” saved [11827]
--2015-03-05 12:27:30-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
[ <=> ] 11,827 --.-K/s in 0.03s
2015-03-05 12:27:31 (401 KB/s) - “nagiosql.login” saved [11827]
--2015-03-05 12:27:31-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”
[ <=> ] 14,759 10.7K/s in 1.3s
2015-03-05 12:27:33 (10.7 KB/s) - “nagiosql.export.monitoring” saved [14759]
Checked 16 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 752 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 16 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
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:31 pm
by tgriep
Can you run the following in a shell
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Then apply the configuration and post the output of the tail?
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:35 pm
by BanditBBS
Ding ding ding, we have a winner!
Code: Select all
PROCESSING COMMAND ID 712...
PROCESS 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-03-05 12:39:11-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
0K .......... . 487K=0.02s
2015-03-05 12:39:12 (487 KB/s) - “nagiosql.login” saved [11827]
/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=o5u57p' -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-03-05 12:39:12-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
0K .......... . 495K=0.02s
2015-03-05 12:39:13 (495 KB/s) - “nagiosql.login” saved [11827]
/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=o5u57p' -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-03-05 12:39:13-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”
0K .......... .... 12.4K=1.2s
2015-03-05 12:39:14 (12.4 KB/s) - “nagiosql.export.monitoring” saved [14683]
WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-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 6512 services.
Checked 752 hosts.
Checked 1 host groups.
Checked 2 service groups.
Checked 11 contacts.
Checked 3 contact groups.
Checked 119 commands.
Checked 16 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 752 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 16 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
Sorry, user nagios is not allowed to execute './manage_services.sh restart nagios' as root on iss-chi-nag01.net.itciss.com.
OUTPUT=RET: 0
RETURNCODE=6
checking visudo now......
EDIT: Checked sudo, looks good
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:41 pm
by tgriep
Is it fixed now?
Re: Apply config failing
Posted: Thu Mar 05, 2015 1:46 pm
by BanditBBS
No sir. That error persists. can you show me what should be in the visudo file? We use an app to keep it up to date and I want to make sure nothing is missing. But the same settings work fine on my prod server which is 2014r2.0. I'm about to upgrade it to 2.6 though
EDIT: Definitely a sudoers file issue. I added this for testing and it worked:
Code: Select all
NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh
Just wondering what else is missing

Re: Apply config failing
Posted: Thu Mar 05, 2015 2:01 pm
by jolson
Try this. Edit:
Code: Select all
/usr/local/nagiosxi/scripts/restart_nagios_with_export.sh
Change line # 44 from:
Code: Select all
sudo $BASEDIR/manage_services.sh restart nagios
To:
Code: Select all
$BASEDIR/manage_services.sh restart nagios
Let us know if that works. Thanks!
Re: Apply config failing
Posted: Thu Mar 05, 2015 2:04 pm
by BanditBBS
Yes, removing that sudo fixed the problem.
Re: Apply config failing
Posted: Thu Mar 05, 2015 2:24 pm
by scottwilkerson
Actually your sudoers file is supposed to have this line in it
visudo
Code: Select all
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
And the sudo should remain...