Page 1 of 2
Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 9:55 am
by disrael
I was looking through the forums and I was curious, is ./reconfigure_nagios.sh another way of "applying configuration"?
Kind Regards,
Doron
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 10:01 am
by mguthrie
Actually it IS the Apply Configuration process

Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 12:26 pm
by disrael
So what exactly goes on, under the hood, when you click, "Apply Configuration" on the server? When we have our siteminder authentication enabled it hangs only on that part. We removed everything in /nagiosql/ from the siteminder protection. After we did that the script itself started to work, though I am curious why the script is hanging when you click apply configuration in the browser.
-Doron
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 12:59 pm
by mguthrie
You can do a running tail on the actual log to trace what happens when you click Apply Configuration in the browser. Send us the output of where it appears to be getting stuck.
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 1:49 pm
by disrael
Code: Select all
Running pre-flight check on configuration data...
Checking services...
Checked 142 services.
Checking hosts...
Checked 24 hosts.
Checking host groups...
Checked 3 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 32 contacts.
Checking contact groups...
Checked 21 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 167 commands.
Checking time periods...
Checked 42 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
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...done.
Stopping nagios: .done.
Starting nagios: done.
RESETTING PERMS
SETUID ROOT OK
/usr/local/nagiosxi/nom/checkpoints/nagioscore /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
tar: /usr/local/nagios/etc/cfgprep/orig/hosts.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/contactgroups.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/services: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/mohit: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/dependencies.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/contactgroups.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/servicetemplate.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/hosttemplate.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/_empty_host.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/contacts.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/hostgroups.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/commands.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/resource.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/contacts.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/timeperiods.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep/orig/contacttemplate.cfg: Cannot stat: Permission denied
tar: Error exit delayed from previous errors
/usr/local/nagiosxi/scripts
OUTPUT=/usr/local/nagiosxi/scripts
RETURNCODE=0
.....tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 1 COMMANDS
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 2:00 pm
by mguthrie
I would move or remove the following directory and see if the issue is resolved:
/usr/local/nagios/etc/cfgprep
The nagios user is trying to read files in that directory but doesn't have permission. Since I'm assuming you're done importing, you can back up those files elsewhere and clear that directory.
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 2:20 pm
by disrael
It didn't work. When we disable siteminder it completes it, though the info for both look the same (one that finished):
Code: Select all
/usr/local/nagiosxi/nom/checkpoints/nagioscore /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
tar: /usr/local/nagios/etc/cfgprep-back/orig/hosts.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/contactgroups.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/services: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/mohit: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/dependencies.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/contactgroups.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/servicetemplate.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/hosttemplate.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/_empty_host.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/contacts.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/hostgroups.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/commands.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/resource.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/contacts.cfg.orig: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/timeperiods.cfg: Cannot stat: Permission denied
tar: /usr/local/nagios/etc/cfgprep-back/orig/contacttemplate.cfg: Cannot stat: Permission denied
tar: Error exit delayed from previous errors
/usr/local/nagiosxi/scripts
OUTPUT=/usr/local/nagiosxi/scripts
RETURNCODE=0
.................................
PROCESSED 1 COMMANDS
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 2:54 pm
by lmiltchev
You just renamed the "cfgprep" directory but you left it in the "/etc". Please, move it to another directory for example "/tmp" and try again.
Code: Select all
mv /usr/local/nagios/etc/cfgprep/ /tmp/
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Apply Configuration.
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 3:17 pm
by disrael
That got rid of those errors, though it didn't fix the issue:
This is being generated in the error_log for apache:
Code: Select all
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 2: parser error : Premature end of data in tag BODY line 1 in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 2: parser error : Premature end of data in tag HTML line 1 in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
[Wed Oct 10 16:11:49 2012] [error] [client 13.131.1.241] PHP Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in /usr/local/nagiosxi/html/includes/utils-backend.inc.php on line 27, referer: http://nagios-test1.corp.xerox.com/nagiosxi/includes/components/nagioscorecfg/applyconfig.php?cmd=confirm
When I disable siteminder and restart apache it finishes:
Configuration applied successfully.
Success! Nagios Core was restarted with an updated configuration
Re: Applying Configuration in the command prompt?
Posted: Wed Oct 10, 2012 4:09 pm
by mguthrie
Do you have short tags enabled in your /etc/php.ini file? If so, disable them and restart apache.
Can you maybe give a brief overview of what siteminder does? If we can understand what better how it interacts with the server we'll maybe have a better chance of understanding what it's breaking.