Applying Configuration in the command prompt?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Applying Configuration in the command prompt?

Post by disrael »

I was looking through the forums and I was curious, is ./reconfigure_nagios.sh another way of "applying configuration"?

Kind Regards,

Doron
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Applying Configuration in the command prompt?

Post by mguthrie »

Actually it IS the Apply Configuration process :)
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Applying Configuration in the command prompt?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Applying Configuration in the command prompt?

Post 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
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Applying Configuration in the command prompt?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Applying Configuration in the command prompt?

Post 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.
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Applying Configuration in the command prompt?

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Applying Configuration in the command prompt?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
disrael
Posts: 116
Joined: Tue Jun 19, 2012 3:16 pm

Re: Applying Configuration in the command prompt?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Applying Configuration in the command prompt?

Post 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.
Locked