Page 1 of 1

Getting "Configuration Verification Failed"

Posted: Wed Nov 09, 2016 1:52 pm
by PhilG
Hello:
We are running Nagios XI 5.2.7 on RHEL 6.5 (Santiago).

Nagios XI and monitoring has been working with no issues until this morning when I noted a service displaying a (benign) warning.

I checked on the respected Host and service(s) and all appeared to be working with no issues (Host is Windows 2008 R2). I noted that the NSClient++ client on the Host was still running version 0.3.9, so I decided to update the client to 0.4.3.

I think that since I did not delete the service(s) and then Host in Nagios XI first is why I am having the following bigger issue.

PROBLEM: After upgrading the NSClient++ on the server, I deleted the associated service(s) and host in Nagios XI and then Applied Configuration. I received the following warning/error after: "Configuration Verification Failed".

What I have attempted to do:
1). I have found this - https://support.nagios.com/kb/article.php?id=39
a). and ran the following command from the Nagios server console:
tail -f /usr/local/nagiosxi/var/cmdsubsys.log

b). Then ran "Apply Configuration" in the web manager console.

c). I copied/pasted the output from the Nagios server console, and attached it to this post (filename "Apply_Configuration_error_20161109.docx").

d). The host and its associated service(s) do not appear in the Nagios XI web manager console (appear to all be deleted), however, the host and service ".cfg" files exist on the Nagios server:
1). "/usr/local/nagios/etc/hosts/<HOSTNAME>.cfg"
-rw-rw-r-- 1 apache nagios 1302 Nov 9 11:09 <HOSTNAME>.cfg

2). "/usr/local/nagios/etc/services/<HOSTNAME>.cfg"
-rw-rw-r-- 1 apache nagios 5270 Nov 9 11:09 <HOSTNAME>.cfg


This is a Production server which resides on a physical box, so we can't do a VM snapshot. Management will be concerned.

Please assist with getting this issue resolved.

Thank you in advance for your assistance!

Re: Getting "Configuration Verification Failed"

Posted: Wed Nov 09, 2016 2:12 pm
by avandemore
XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs > Verify Files > Restart Nagios Core

I think the names now are different but something similar should be in your version.

Did this help?

The output to me suggests the apply config user isn't right. If the above doesn't help try this as root from the CLI:

Code: Select all

# cd /usr/local/nagiosxi/scripts/
# ./reconfigure_nagios.sh
Please post the output.

Re: Getting "Configuration Verification Failed"

Posted: Wed Nov 09, 2016 2:32 pm
by PhilG
Hello:
Do not see or find "Config File Management", so should I try:
XI > Configure > Core Config Manager > Tools > Write Config Files > Delete ("Delete All Host / Service Configuration Files"), and then Write ("Write Configs To File") > Verify ("Verify Configuration") > Restart ("Restart Nagios")?

avandemore wrote:XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs > Verify Files > Restart Nagios Core

I think the names now are different but something similar should be in your version.

Did this help?

The output to me suggests the apply config user isn't right. If the above doesn't help try this as root from the CLI:

Code: Select all

# cd /usr/local/nagiosxi/scripts/
# ./reconfigure_nagios.sh
Please post the output.

Re: Getting "Configuration Verification Failed"

Posted: Wed Nov 09, 2016 2:40 pm
by avandemore
Yes, that is correct for the older naming convention.

Re: Getting "Configuration Verification Failed"

Posted: Thu Nov 10, 2016 10:48 am
by PhilG
I did up to "Verify Configuration" and received the following (I did not do the restart or the CLI command(s) yet):

=====================================================================================
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/<NAGIOSXI_SERVER>.cfg', starting on line 16)

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/<NAGIOSXI_SERVER>.cfg', starting on line 16)
Error processing object config files!


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



"/usr/local/nagios/etc/services/<NAGIOSXI_SERVER>.cfg" file's content is provided, below. Line 16 is the first "define service" line:
"
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2016-11-10 09:04:11
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name <NAGIOSXI_SERVER>
use xiwizard_windowsserver_nsclient_service
servicegroups Prod App Servers,Prod Web IIS Servers
check_command check_xi_service_nsclient!<PASSWORD>!SERVICESTATE!-l memcached -d SHOWALL
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
first_notification_delay 15
notification_period xi_timeperiod_24x7
contacts Standby
contact_groups <2_GROUPS>
_xiwizard windowsserver
register 1
}

define service {
host_name <NAGIOSXI_SERVER>
service_description CPU Usage
use xiwizard_windowsserver_nsclient_service
servicegroups Prod App Servers,Prod Web IIS Servers
check_command check_xi_service_nsclient!<PASSWORD>!CPULOAD!-l 5,90,95
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
first_notification_delay 15
notification_period xi_timeperiod_24x7
contacts Standby
contact_groups <2_GROUPS>
_xiwizard windowsserver
"

ISSUE:
1). <NAGIOSXI_SERVER> is the name of my Nagios XI server, which runs on Linux, NOT Windows, so "use", "servicegroups", and "_xiwizard" are incorrect.
UPDATE: This can be fixed for the Ping service by changing the Groups in the web management console, but I still get "Configuration error. Could not apply configuration." when trying to update.

2). In "/usr/local/nagios/etc/services":
a). the ".cfg" file (<DELETED_WINDOWS_SERVER>.cfg) for the Windows Host and Service(s), which I removed in the web management console, does not exist.
b). <NAGIOSXI_SERVER>.cfg exists (content was provided above), but I only monitor for Ping, as noted in my snapshot.

4). In "/usr/local/nagios/etc/hosts":
a). <NAGIOSXI_SERVER>.cfg exists (content provided below (A)), and is correct.
b). <DELETED_WINDOWS_SERVER>.cfg exists (content provided below (B)), though.


(A). "/usr/local/nagios/etc/hosts", <NAGIOSXI_SERVER>.cfg
###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2016-11-10 09:04:02
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
host_name <NAGIOSXI_SERVER>
use xiwizard_generic_host
address <CORRECT_IP>
hostgroups linux-servers
max_check_attempts 3
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts <COMMA_SEPARATED_CONTACT_NAMES>
contact_groups <GROUP>
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
_xiwizard autodiscovery
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################



(B). "/usr/local/nagios/etc/hosts", <DELETED_WINDOWS_SERVER>.cfg

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2016-11-10 09:04:03
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
host_name <DELETED_WINDOWS_SERVER>
use xiwizard_windowsserver_host
address <CORRECT_IP>
hostgroups windows-servers
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts <CONTACTS>
contact_groups <COMMA-SEPARATED_CONTACT_GROUPS>
notification_interval 60
notification_period xi_timeperiod_24x7
first_notification_delay 15
icon_image win_server.png
statusmap_image win_server.png
_xiwizard windowsserver
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################








PhilG wrote:Hello:
Do not see or find "Config File Management", so should I try:
XI > Configure > Core Config Manager > Tools > Write Config Files > Delete ("Delete All Host / Service Configuration Files"), and then Write ("Write Configs To File") > Verify ("Verify Configuration") > Restart ("Restart Nagios")?

avandemore wrote:XI > Configure > Core Config Manager > Config File Management > Delete Files > Write Configs > Verify Files > Restart Nagios Core

I think the names now are different but something similar should be in your version.

Did this help?

The output to me suggests the apply config user isn't right. If the above doesn't help try this as root from the CLI:

Code: Select all

# cd /usr/local/nagiosxi/scripts/
# ./reconfigure_nagios.sh
Please post the output.

Re: Getting "Configuration Verification Failed"

Posted: Thu Nov 10, 2016 11:30 am
by avandemore
The first service you have listed doesn't list a service_description. Please see this for reference:

Service Definitions

So either fix that or you can revert to an earlier known good state at this screen:

XI > Configure > CCM > Configuration Snapshots

Click the "Restore" button for the snapshot you would like to revert too.

Re: Getting "Configuration Verification Failed"

Posted: Thu Nov 10, 2016 11:54 am
by PhilG
I did a revert and am monitoring at this time.

I noted that the Windows server/Host that I wanted to delete exists, but the services were gone (successful deletion, I guess).

I was able to delete the Windows server/Host and apply the configuration change at this time, and all appears to be functioning properly!

I verified "/usr/local/nagios/etc/services/<NAGIOSXI_SERVER>.cfg" and that has the correct information, along with a service_description.

Something got corrupted, it appears, but now all good.

Thank you for your assistance!

You can lock this post.

avandemore wrote:The first service you have listed doesn't list a service_description. Please see this for reference:

Service Definitions

So either fix that or you can revert to an earlier known good state at this screen:

XI > Configure > CCM > Configuration Snapshots

Click the "Restore" button for the snapshot you would like to revert too.

Re: Getting "Configuration Verification Failed"

Posted: Thu Nov 10, 2016 12:22 pm
by avandemore
Great, glad we could be of help. If you have further issues, please open a new thread.