Waiting for configuration verification never ends.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

Hi ,

I got the root password and i am able to execute the script as nagios user.
Anyhow i have few more errors coming up.

I have done the changes but shows the same error.
Down
Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
chmod u+s yourpluginfile
check_icmp: Failed to obtain ICMP socket: Operation not permitted

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/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&backend=1&username=nagiosxi&password=4RW8B4BVjbWD' -O nagiosql.login--2018-11-07 16:18:19-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

[ <=> ] 36,800 --.-K/s in 0.02s

2018-11-07 16:18:19 (2.20 MB/s) - ‘nagiosql.login’ saved [36800]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/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&backend=1&username=nagiosxi&password=4RW8B4BVjbWD' -O nagiosql.login--2018-11-07 16:18:20-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

[ <=> ] 36,800 --.-K/s in 0.02s

2018-11-07 16:18:20 (1.78 MB/s) - ‘nagiosql.login’ saved [36800]

LOGIN 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 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-11-07 16:18:21-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.export.monitoring’

[ <=> ] 22,065 --.-K/s in 0.01s

2018-11-07 16:18:21 (1.65 MB/s) - ‘nagiosql.export.monitoring’ saved [22065]

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...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 13 services.
Checked 3 hosts.
Checked 12 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 124 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 3 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 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
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Waiting for configuration verification never ends.

Post by ssax »

First try deleting the nagios password (if you haven't yet):

Code: Select all

passwd -d nagios
Then test, if it still fails try adding nagios to the wheel group:

Code: Select all

usermod -aG wheel nagios
Then test, if that doesn't fix it, please send me the output of this command:

Code: Select all

grep nag /etc/passwd
<- UID for nagios should 1000 or higher

And attach these file (if you have them):

Code: Select all

/etc/sudoers
/etc/cron.allow
/etc/cron.deny
/etc/polkit-1/rules.d/50-default.rules
For the check_icmp issue, please run this command:

Code: Select all

chmod u+s /usr/local/nagios/libexec/check_icmp
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

Please find the below output.


[root@njbbngeoxp3v ~]# grep nag /etc/passwd
nagios:x:157346:4015:Nagios Local User:/usr/local/nagios:/bin/bash


Defaults:nagios !requiretty
Defaults syslog=local1
Defaults syslog_goodpri=notice
Defaults syslog_badpri=notice

# Section Start - User privilege specification
root ALL = (ALL) ALL
kollusu ALL = (ALL) ALL
HP_SRVR_MGMT_GROUP ALL = NOPASSWD: /etc/init.d/snmpd, /usr/bin/snmptrap
STDSAUDI ALL = NOPASSWD: /bin/cat, /bin/ls, /bin/netstat, /bin/lsof, /usr/sbin/dmidecode
MONTOOL_GROUP ALL = NOPASSWD: /usr/sbin/vxdisk list, /bin/touch, /usr/openv/netbackup/bin/bplist
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/reconfigure_nagios.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 *

root ALL=(ALL) ALL
[root@njbbngeoxp3v ~]# cat /etc/cron.allow

# Section Start - Users permitted to use Cron
root
stdsmont
oracle
arcgis
netgeo
weblogic
fme
geoplan
sde
apache
nagios
[root@njbbngeoxp3v ~]# cat /etc/cron.deny
[root@njbbngeoxp3v ~]# cat /etc/polkit-1/rules.d/50-default.rules
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
});
[root@njbbngeoxp3v ~]# chmod u+s /usr/local/nagios/libexec/check_icmp
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Waiting for configuration verification never ends.

Post by ssax »

So none of those changes fixed it?

Is this system AD/LDAP integrated? (Meaning your credentials when SSHing to the server are AD/LDAP ones)
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

[root@njbbngeoxp3v ~]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
PROCESSED 0 COMMANDS
.............................................................
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
...........................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
............................................................
PROCESSED 0 COMMANDS
......................PROCESSING COMMAND ID 58...
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
--2018-11-07 17:39:24-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

0K .......... .......... .......... .... 1.68M=0.02s

2018-11-07 17:39:24 (1.68 MB/s) - ‘nagiosql.login’ saved [35562]

/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&backend=1&username=nagiosxi&password=4RW8B4BVjbWD' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2018-11-07 17:39:25-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘nagiosql.login’

0K .......... .......... .......... .... 1.51M=0.02s

2018-11-07 17:39:26 (1.51 MB/s) - ‘nagiosql.login’ saved [35562]

/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&backend=1&username=nagiosxi&password=4RW8B4BVjbWD' -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 'backend=1&cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2018-11-07 17:39:26-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (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.40M=0.01s

2018-11-07 17:39:26 (1.40 MB/s) - ‘nagiosql.export.monitoring’ saved [21930]

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...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 12 services.
Checked 1 hosts.
Checked 12 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 124 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 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
Failed to restart nagios.service: Interactive authentication required.
See system logs and 'systemctl status nagios.service' for details.
OUTPUT=RET: 0
RETURNCODE=6
..................................
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

Its LDAP
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

I can run the apply configuration GUI mode which is running good.

Getting the below errors.
Apply Configuration
Nagios restart command failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

And the warning about localhost
Down
Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
chmod u+s yourpluginfile
check_icmp: Failed to obtain ICMP socket: Operation not permitted


[root@njbbngeoxp3v ~]# ll /usr/local/nagios/libexec/check_icmp
-rwsrwxr-x 1 root nagios 213912 Nov 5 12:05 /usr/local/nagios/libexec/check_icmp
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

Hi,

Do i need to reinstall nagios, Unable to get rid of this issue.
Looks like apply configuration is working fine. But the changes dosent reflect.
suryakiran
Posts: 34
Joined: Tue Nov 06, 2018 12:02 pm

Re: Waiting for configuration verification never ends.

Post by suryakiran »

Hi,

Surprisingly, I have upgraded the nagios version and now i am able to do the below.
Apply Configuration
Configuration applied successfully.
Nagios Core was restarted with an updated configuration.

And also able to run the script without any hassle.

-bash-4.2$ /usr/local/nagiosxi/scripts/reconfigure_nagios.sh

--- reset_config_perms.sh ------------
> Setting CCM script permissions
> Setting script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting NOM checkpoint user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------

--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
No files to import
--------------------------------------

--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Finished writing out configuraton
--------------------------------------

--------------------------------------
> Verifying configuration with Nagios Core
> Output:
Nagios Core 4.4.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-08-16
License: GPL

Website: https://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 12 services.
Checked 1 hosts.
Checked 12 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 128 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 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
> Return Code: 0
--------------------------------------


Any how the warning about local host is still the same.
And the warning about localhost
Down
Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
chmod u+s yourpluginfile
check_icmp: Failed to obtain ICMP socket: Operation not permitted


[root@njbbngeoxp3v ~]# ll /usr/local/nagios/libexec/check_icmp
-rwsrwxr-x 1 root nagios 213912 Nov 5 12:05 /usr/local/nagios/libexec/check_icmp
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Waiting for configuration verification never ends.

Post by ssax »

Please run this command and the PM me the resulting /tmp/polkit_files.zip file:

Code: Select all

zip -r /tmp/polkit_files.zip /etc/polkit-1 /usr/share/polkit-1
Locked