Waiting for configuration verification stuck

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
emsadmin
Posts: 10
Joined: Fri Dec 01, 2017 1:35 am

Waiting for configuration verification stuck

Post by emsadmin »

Hi,

I just installed the Nagios xi, when I "apply configuration", it was stucking "Waiting for configuration verification............................................"

Please advise, thank you.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Waiting for configuration verification stuck

Post by mcapra »

Have you configured Nagios XI to use HTTPS? If so, did you follow the official documentation for setting that up?

Is this machine behind a proxy for its internet access? If so, did you follow the proxy setup guide?

Can you share the output of the following command executed from the CLI of your Nagios XI machine:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Former Nagios employee
https://www.mcapra.com/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Waiting for configuration verification stuck

Post by dwhitfield »

OP, definitely take a look at the two articles @macapra sent, but if those don't help you resolve the issue, you will want to take a look at https://support.nagios.com/kb/article/n ... es-34.html
emsadmin
Posts: 10
Joined: Fri Dec 01, 2017 1:35 am

Re: Waiting for configuration verification stuck

Post by emsadmin »

mcapra wrote:Have you configured Nagios XI to use HTTPS? If so, did you follow the official documentation for setting that up?
I followed the document already, it still doesn't help

Is this machine behind a proxy for its internet access? If so, did you follow the proxy setup guide?
The machine has no internet access and don't connect to the proxy

Can you share the output of the following command executed from the CLI of your Nagios XI machine:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
[root@lab006 11:43]$ cat /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
#!/bin/bash
# Copyright (c) 2008-2016 Nagios Enterprises, LLC. All rights reserved.

# exit codes:
# 1 config verification failed
# 2 nagiosql login failed
# 3 nagiosql import failed
# 4 reset_config_perms.sh failed
# 5 nagiosql_exportall.php failed (write configs failed)
# 6 /etc/init.d/nagios restart failed
# 7 db_connect failed
#

BASEDIR=$(dirname $(readlink -f $0))

# Import data to NagiosQL
$BASEDIR/import_nagiosql.sh
ret=$?
if [ $ret -gt 0 ]; then
exit $ret
fi

# Restart Nagios
$BASEDIR/restart_nagios_with_export.sh

ret=$?
if [ $ret -gt 0 ]; then
exit $ret
fi

exit 0[root@lab006 11:58]$
kyang

Re: Waiting for configuration verification stuck

Post by kyang »

Thanks, but I think executing it through the command line instead of a "cat" is what we wanted to see.

Run it like this without the "cat"

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Post the output, thanks!

You can also take a look at the kb article @dwhitfield suggested if you haven't already.
https://support.nagios.com/kb/article/n ... es-34.html

Let us know!
emsadmin
Posts: 10
Joined: Fri Dec 01, 2017 1:35 am

Re: Waiting for configuration verification stuck

Post by emsadmin »

kyang wrote:Thanks, but I think executing it through the command line instead of a "cat" is what we wanted to see.

Run it like this without the "cat"

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Post the output, thanks!

You can also take a look at the kb article @dwhitfield suggested if you haven't already.
https://support.nagios.com/kb/article/n ... es-34.html

I already went through this post but no help --

Let us know!

Code: Select all

[gadmin@lab006 12:10]$ /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=e6Ml3oQU3CHi' -O nagiosql.loginnagiosql.login: Permission denied
LOGIN SUCCESSFUL!
NAGIOSQL LOGIN FAILED!

Code: Select all

[gadmin@lab006 12:10]$ sudo -s
[root@lab006 12:11]$ /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=e6Ml3oQU3CHi' -O nagiosql.login--2018-01-02 12:11:01--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]â
                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                                                ] 25,317      --.-K/s   in 0.01s

2018-01-02 12:11:02 (2.17 MB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: https://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=e6Ml3oQU3CHi' -O nagiosql.login--2018-01-02 12:11:02--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]
                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                                                ] 25,317      --.-K/s   in 0.01s

2018-01-02 12:11:02 (2.16 MB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-01-02 12:11:02--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]

                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.export.monitoringâ

    [ <=>                                                                                                                ] 21,855      --.-K/s   in 0.007s

2018-01-02 12:11:02 (2.85 MB/s) - ânagiosql.export.monitoringâ

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Template '' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 271)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /home/gadmin
tar: Removing leading `/' from member names
/home/gadmin
ls: cannot access /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: No such file or directory
NO NOM SNAPSHOT FOUND!
[root@lab006 12:11]$
Last edited by dwhitfield on Tue Jan 02, 2018 9:45 am, edited 1 time in total.
Reason: code blocks ftw
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Waiting for configuration verification stuck

Post by dwhitfield »

It looks like you have some issues with your sudoers file, but it's hard to say since you aren't running the script as the nagios user.

Please run the following commands in order. Do not make *any* changes to them. Then, provide the output of each.

Code: Select all

su - nagios
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
emsadmin
Posts: 10
Joined: Fri Dec 01, 2017 1:35 am

Re: Waiting for configuration verification stuck

Post by emsadmin »

dwhitfield wrote:It looks like you have some issues with your sudoers file, but it's hard to say since you aren't running the script as the nagios user.

Please run the following commands in order. Do not make *any* changes to them. Then, provide the output of each.

Code: Select all

su - nagios
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

Code: Select all

[root@lab006 12:11]$ su - nagios

Code: Select all

[nagios@lab006 ~]$ /usr/local/nagiosxi/scripts/reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=e6Ml3oQU3CHi' -O nagiosql.login--2018-01-03 09:43:18--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]â
                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                                                ] 25,317      --.-K/s   in 0.01s

2018-01-03 09:43:18 (2.27 MB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: https://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=e6Ml3oQU3CHi' -O nagiosql.login--2018-01-03 09:43:19--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]
                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.loginâ

    [ <=>                                                                                                                ] 25,317      --.-K/s   in 0.01s

2018-01-03 09:43:19 (2.17 MB/s) - ânagiosql.loginâ

LOGIN SUCCESSFUL!
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-01-03 09:43:19--  https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhostâs certificate, issued by â/C=HK/ST=HK/L=HK/O=test/CN=lab006/[email protected]â
                                                                                                                                                       Self-signed certificate encountered.
    WARNING: certificate common name âlab006âlocalhostâ
                                                               HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ânagiosql.export.monitoringâ

    [ <=>                                                                                                                ] 21,855      --.-K/s   in 0.008s

2018-01-03 09:43:19 (2.58 MB/s) - ânagiosql.export.monitoringâ

WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Template '' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 271)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
RET: 1
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors ~
tar: Removing leading `/' from member names
~
ls: cannot access /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: No such file or directory
NO NOM SNAPSHOT FOUND!
[nagios@lab006 ~]$
Last edited by dwhitfield on Wed Jan 03, 2018 10:41 am, edited 1 time in total.
Reason: code blocks FTW
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Waiting for configuration verification stuck

Post by dwhitfield »

Please make sure your /etc/sudoers contains the following at the end:

Code: Select all

User_Alias      NAGIOSXI=nagios
User_Alias              NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
Additionally, what is the output of the following commands (in order):

Code: Select all

sestatus
grep nag /etc/passwd
grep nag /etc/group
grep apache /etc/passwd
grep apache /etc/group
su - nagios
umask
exit
Lastly, it would be ideal if you could post your /etc/sudoers for review.
emsadmin
Posts: 10
Joined: Fri Dec 01, 2017 1:35 am

Re: Waiting for configuration verification stuck

Post by emsadmin »

dwhitfield wrote:Please make sure your /etc/sudoers contains the following at the end:

Code: Select all

User_Alias      NAGIOSXI=nagios
User_Alias              NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
Additionally, what is the output of the following commands (in order):

Code: Select all

sestatus
grep nag /etc/passwd
grep nag /etc/group
grep apache /etc/passwd
grep apache /etc/group
su - nagios
umask
exit
Lastly, it would be ideal if you could post your /etc/sudoers for review.
Please make sure your /etc/sudoers contains the following at the end:
Yes, all contain. Our server admin doesn't allow to provide the whole /etc/sudoers

[root@lab006 15:55]$ sestatus
SELinux status: disabled
[root@lab006 15:55]$ grep nag /etc/passwd
nagios:x:56678:100::/home/nagios:/bin/bash
[root@lab006 15:55]$ grep nag /etc/group
nagcmd:x:59894:apache,nagios
nagios:x:59895:apache,nagios
[root@lab006 15:55]$ grep apache /etc/passwd
apache:x:48:48:Apache:/var/www:/sbin/nologin
[root@lab006 15:56]$ grep apache /etc/group
apache:x:48:
nagcmd:x:59894:apache,nagios
nagios:x:59895:apache,nagios
[root@lab006 15:56]$ su - nagios
[nagios@lab006 ~]$ umask
0022
[nagios@lab006 ~]$ exit
logout
[root@lab006 15:56]$
Locked