Page 1 of 1

Missing host_name in service.cfg after update

Posted: Wed Oct 04, 2017 7:33 am
by Support_Talea
Hi support,
i am not able to open topic in customer forum (but we have purchased the license, we have the customer id).
We encounter a problem after nagios upgrade from 5.2.9 to 5.4.9.
Once we modify any service inside the config manager we receive an "apply configuration" error:
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/myservername.cfg', starting on line 88)

This is the original configuration:

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2017-09-06 18:10:29
# 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 myservername
service_description CPU Usage
use TMP_srv_gen_noH24
check_command check_xi_service_nsclient!!CPULOAD!-l 5,90,95!!!!!
_xiwizard windowsserver_sacmi
register 1
}


after the apply the service cfg result like this, but in the gui the hostname is correctly associated:
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.8
# Date: 2017-10-02 17:18:20
# 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 {
service_description CPU Usage
use TMP_srv_gen_noH24
check_command check_xi_service_nsclient!!CPULOAD!-l 5,90,95!!!!!
_xiwizard windowsserver_sacmi
register 1
}


If we modify host/hostgroup and so.. we do not encounter any error in applyng the config.
Thanks
Support Talea :ugeek:

Re: Missing host_name in service.cfg after update

Posted: Wed Oct 04, 2017 1:17 pm
by mcapra
Support_Talea wrote: i am not able to open topic in customer forum (but we have purchased the license, we have the customer id).
I would recommend contacting sales (sales at nagios dot com) with either your customer ID number or the last 4 of your product key as well as your forums username. They can get you access to the customer section.

Regarding the problem itself, have you tried the steps mentioned in this article:
https://support.nagios.com/kb/article.php?id=144

Typically a Delete -> Write -> Verify can help solve such inconsistencies.

Re: Missing host_name in service.cfg after update

Posted: Wed Oct 04, 2017 1:59 pm
by kyang
Thanks @mcapra!

As mcapra said, please contact our sales department and they can give you access to the customer forums.

Let us know if the Delete --> Write --> Verify --> Apply configuration has solved your host_name issue. (This is done in the Core Config Manager)