Page 1 of 1

Service Nagios restart issue

Posted: Fri Sep 18, 2015 5:36 am
by raamardhani7
Hi Team,

When I am trying to restart Nagios XI services, I am getting the below error. Could you please help with me??

[root@lusrcdnagiosxi00 hosts]# service nagios restart
Running configuration check...

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://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/172.31.0.10.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 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.

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 7:33 am
by jdalrymple
Kindly post the sanitized contents of that file:

/usr/local/nagios/etc/services/172.31.0.10.cfg
raamardhani7 wrote:Error: Service has no hosts and/or service_description
Did you recently create a service and not give it a service_description?

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 8:28 am
by raamardhani7
jdalrymple wrote:Kindly post the sanitized contents of that file:

/usr/local/nagios/etc/services/172.31.0.10.cfg
raamardhani7 wrote:Error: Service has no hosts and/or service_description
Did you recently create a service and not give it a service_description?
Hi.. Please find the below output

[root@lusrcdnagiosxi00 ~]# more /usr/local/nagios/etc/services/172.31.0.10.cfg
/usr/local/nagios/etc/services/172.31.0.10.cfg: No such file or directory
[root@lusrcdnagiosxi00 ~]# cat /usr/local/nagios/etc/services/172.31.0.10.cfg
cat: /usr/local/nagios/etc/services/172.31.0.10.cfg: No such file or directory
[root@lusrcdnagiosxi00 ~]# service nagios start
Starting nagios:
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Contact 'cruz' is not defined anywhere!
Error: Could not add contact 'cruz' to host (config file '/usr/local/nagios/etc/hosts/117.30.246.113.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 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.


[root@lusrcdnagiosxi00 ~]# cat /usr/local/nagios/etc/hosts/117.30.246.113.cfg
###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.3.3
# Date: 2015-09-18 07:35:54
# 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 117.30.246.113
use xiwizard_windowsserver_host
address 117.30.246.113
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts cruz
notification_interval 60
notification_period xi_timeperiod_24x7
icon_image win_server.png
statusmap_image win_server.png
_xiwizard windowsserver
register 1
}

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

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 8:57 am
by jdalrymple
You've done something to change the problem:
raamardhani7 wrote:Error: Contact 'cruz' is not defined anywhere!
Not sure how you're getting a non-existent contact into a definition. Did you do any fancy config importing or anything recently? Maybe create a contact "cruz"

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 9:00 am
by raamardhani7
jdalrymple wrote:You've done something to change the problem:
raamardhani7 wrote:Error: Contact 'cruz' is not defined anywhere!
Not sure how you're getting a non-existent contact into a definition. Did you do any fancy config importing or anything recently? Maybe create a contact "cruz"
I think recently I have created a contact called Cruz, but didnt do any importing stuff. Could you please advise what can be done here???

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 9:04 am
by jdalrymple
Verify the contact still exists in CCM.
raamardhani7 wrote:Error: Contact 'cruz' is not defined anywhere!
That is the problem - that is what needs to be fixed. Either remove cruz from the defined hosts/services (again I'm not sure how you could have even gotten it there without it being defined) or make sure it exists.

You might have your configurations in a total state of disarray, it might be a good time to use the Write Config Files tool to delete/write/verify/restart. Those tools are in CCM.

Re: Service Nagios restart issue

Posted: Fri Sep 18, 2015 9:14 am
by raamardhani7
jdalrymple wrote:Verify the contact still exists in CCM.
raamardhani7 wrote:Error: Contact 'cruz' is not defined anywhere!
That is the problem - that is what needs to be fixed. Either remove cruz from the defined hosts/services (again I'm not sure how you could have even gotten it there without it being defined) or make sure it exists.

You might have your configurations in a total state of disarray, it might be a good time to use the Write Config Files tool to delete/write/verify/restart. Those tools are in CCM.
Service and host details are there in CCM, removed them and configured other server, things are working fine now.

service nagios restart
Running configuration check...
Stopping nagios: done.
Starting nagios: done.

You can close this, thanks for your help. Need your help on my other thread, please help me with that too.. Thanks again.. :)