Page 1 of 1

apply configuration error

Posted: Tue Nov 27, 2018 4:52 pm
by wspackaging
I get this error when I try to save a new node into nagios.

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/dc1ux001.cfg', starting on line 16)
Error: Service escalation host name or description is NULL
Error: Could not register service escalation (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)

the server dc1ux001 has been deleted months ago. Not sure why it is causing an error now.
I do still see all the configuration files in:

/usr/local/nagios/share/perfdata/

I ran a /usr/local/nagiosxi/scripts/repair_databases.sh and upgraded to the latest version 5.5.7.

any other suggestions?

-pete

Re: apply configuration error

Posted: Tue Nov 27, 2018 5:23 pm
by lmiltchev
What do you see on line 16 in /usr/local/nagios/etc/services/dc1ux001.cfg and /usr/local/nagios/etc/serviceescalations.cfg?

Go to the CCM > Tools > Config File Management, click on Delete Files, then click on Write Configs and Verfiy Files. Copy/paste any config errors that you see in the output on the forum.

Re: apply configuration error

Posted: Wed Nov 28, 2018 9:56 am
by wspackaging
the file /usr/local/nagios/etc/services/dc1ux001.cfg does not exist.

the file /usr/local/nagios/etc/serviceescalations.cfg looks like this:
###############################################################################
#
# Serviceescalations configuration file
#
# Created by: Nagios CCM 2.7.3
# Date: 2018-11-28 06:10:31
# Version: Nagios Core 4.x
#
# --- 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 serviceescalation {
# config_name Network High
hostgroup_name Network High
service_description Ping
contacts nampb
contact_groups Network High
first_notification 1
last_notification 0
notification_interval 30
escalation_period 24x7
escalation_options w,u,c,r,
}

###############################################################################
#
# Serviceescalations configuration file
#
# END OF FILE
#
###############################################################################


The output from "Verify Files":
Error: Could not find a service matching host name 'NY1RT001' and description 'Ping' (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)
Error: Service escalation host name or description is NULL
Error: Could not register service escalation (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)

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...
Warning: Duplicate definition found for service 'Uptime' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 111)
Warning: Duplicate definition found for service 'Server Work Queues' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 95)
Warning: Duplicate definition found for service 'Ping' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 80)
Warning: Duplicate definition found for service 'Page File Usage' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 64)
Warning: Duplicate definition found for service 'Memory Usage' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 48)
Warning: Duplicate definition found for service 'CPU Usage' on host 'dc1ms030167.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms030167.wspg.com.cfg', starting on line 16)
Warning: Duplicate definition found for service 'Uptime' on host 'dc1ms032100.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms032100.wspg.com.cfg', starting on line 102)
Warning: Duplicate definition found for service 'Memory Usage' on host 'dc1ms032100.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms032100.wspg.com.cfg', starting on line 85)
Warning: Duplicate definition found for service 'CPU Usage' on host 'dc1ms032100.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ms032100.wspg.com.cfg', starting on line 16)
Warning: Duplicate definition found for service 'Uptime' on host 'tn3ms115.wspg.com' (config file '/usr/local/nagios/etc/services/tn3ms115.wspg.com.cfg', starting on line 151)
Warning: Duplicate definition found for service 'Ping' on host 'tn3ms115.wspg.com' (config file '/usr/local/nagios/etc/services/tn3ms115.wspg.com.cfg', starting on line 135)
Warning: Duplicate definition found for service 'Memory Usage' on host 'tn3ms115.wspg.com' (config file '/usr/local/nagios/etc/services/tn3ms115.wspg.com.cfg', starting on line 118)
Warning: Duplicate definition found for service 'CPU Usage' on host 'tn3ms115.wspg.com' (config file '/usr/local/nagios/etc/services/tn3ms115.wspg.com.cfg', starting on line 16)
Warning: Duplicate definition found for service '/log Disk Usage' on host 'dc1ux060100' (config file '/usr/local/nagios/etc/services/dc1ux060100.cfg', starting on line 97)
Warning: Duplicate definition found for service 'Uptime' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 182)
Warning: Duplicate definition found for service 'Server Work Queues' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 166)
Warning: Duplicate definition found for service 'Ping' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 150)
Warning: Duplicate definition found for service 'Page File Usage' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 134)
Warning: Duplicate definition found for service 'Memory Usage' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 32)
Warning: Duplicate definition found for service 'CPU Usage' on host 'dc1ms030166.wspg.com' (config file '/usr/local/nagios/etc/services/sqlserver.wspg.com.cfg', starting on line 16)
Warning: Duplicate definition found for service 'Ping' on host 'dc1ms030150.wspg.com' (config file '/usr/local/nagios/etc/services/dc1ux817.wspg.com.cfg', starting on line 16)
Error: Could not find a service matching host name 'NY1RT001' and description 'Ping' (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)
Error: Service escalation host name or description is NULL
Error: Could not register service escalation (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)
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 definitions. 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.

Re: apply configuration error

Posted: Wed Nov 28, 2018 11:08 am
by lmiltchev
The issue is with your escalation. Most probably, if you deactivated it, you would be able to apply configuration successfully. In your escalation, you don't have a host, but a host group specified.
define serviceescalation {
..
hostgroup_name Network High
..
}
Your config verification shows the errors below:
Error: Could not find a service matching host name 'NY1RT001' and description 'Ping' (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)
Error: Service escalation host name or description is NULL
Error: Could not register service escalation (config file '/usr/local/nagios/etc/serviceescalations.cfg', starting on line 16)
I would assume that host 'NY1RT001' doesn't have a 'Ping' service. You could either add 'Ping' service to the host, or remove the 'NY1RT001' from the 'Network High' hostgroup. You may need to do the Delete, Write, Verify and fix any other errors that you may find before applying configuration.

Let us know if this helped.

Re: apply configuration error

Posted: Wed Nov 28, 2018 11:40 am
by wspackaging
I was able to restore to a snap shot from 2 days ago. looks like somebody tried to add or delete something in Nagios and something got messed up.

I'll go back through and figure out how to redefine ny1rt001.

thanks for your help.
Closing the ticket
-pete