Verify config file error after host added

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
steven.giang
Posts: 38
Joined: Tue May 12, 2015 3:08 am

Verify config file error after host added

Post by steven.giang »

Hi All,

I have spend hours on this issue and tried to resolve by researching on the net as people mentions this seem to be very common, however I just couldn't figure it out why. Much appreciated if you could please advise.
1. Nagios 4.0.8
2. Centos 6.5 Final
3. Before first windows server host add

Go to CCM -> write config files

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
Verify config files

Code: Select all

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...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 3 contacts.
Checked 3 contact groups.
Checked 138 commands.
Checked 10 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 10 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 
This is after I added the host to monitor

Code: Select all

Error: Failed to locate check_period 'xi_timeperiod_24x7' for host 'abtsvr01.abtgroup.com.au'!
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/abtsvr01.abtgroup.com.au.cfg', starting on line 14)

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...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
Read main config file okay...
Error: Failed to locate check_period 'xi_timeperiod_24x7' for host 'abtsvr01.abtgroup.com.au'!
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/abtsvr01.abtgroup.com.au.cfg', starting on line 14)
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.
These are the time period config which it look correctly,
/usr/local/nagios/etc/static/xiobjects.cfg

Code: Select all

# XI OBJECTS - DO NOT MODIFY!


	
####################################################
# CONTACTS
####################################################

define contact{
	contact_name       		xi_default_contact
	email					root@localhost
	alias                   Default Contact
	host_notification_commands		xi_host_notification_handler
	service_notification_commands	xi_service_notification_handler
	host_notification_period		xi_timeperiod_none
	service_notification_period		xi_timeperiod_none
	host_notification_options		n
	service_notification_options	n
	}
	
	
####################################################
# HOST GROUPS
####################################################


	
####################################################
# TIMEPERIODS
####################################################

define timeperiod{
	timeperiod_name	xi_timeperiod_none
	alias			None
	}
/usr/local/nagios/etc/timeperiods.cfg

Code: Select all

###############################################################################
#
# Timeperiod configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:	      2015-05-15 10:01:42
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define timeperiod {
	timeperiod_name               		24 x 7
	alias                         		24 Hours A Day, 7 Days A Week
	saturday                      		00:00-24:00
	sunday                        		00:00-24:00
	thursday                      		00:00-24:00
	wednesday                     		00:00-24:00
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	friday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		eg 24x7_sans_holidays
	alias                         		24x7 Sans Holidays
	sunday                        		00:00-24:00
	monday                        		00:00-24:00
	tuesday                       		00:00-24:00
	wednesday                     		00:00-24:00
	thursday                      		00:00-24:00
	friday                        		00:00-24:00
	saturday                      		00:00-24:00
	use                           		us-holidays
	}	

define timeperiod {
	timeperiod_name               		eg nagiosadmin_notification_times
	alias                         		Notification Times for nagiosadmin
	tuesday                       		00:00-24:00
	monday                        		00:00-24:00
	wednesday                     		00:00-24:00
	thursday                      		00:00-24:00
	saturday                      		00:00-24:00
	sunday                        		00:00-24:00
	friday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		eg nightsequence
	alias                         		exclude night sequence hours, 7 Days A Week
	saturday                      		04:00-23:30
	friday                        		04:00-23:30
	thursday                      		04:00-23:30
	wednesday                     		04:00-23:30
	tuesday                       		04:00-23:30
	monday                        		04:00-23:30
	sunday                        		04:00-23:30
	}	

define timeperiod {
	timeperiod_name               		eg us-holidays
	alias                         		U.S. Holidays
	name                          		us-holidays
	monday 1 september            		00:00-00:00
	july 4                        		00:00-00:00
	thursday -1 november          		00:00-00:00
	january 1                     		00:00-00:00
	december 25                   		00:00-00:00
	}	

define timeperiod {
	timeperiod_name               		eg xi_timeperiod_24x7
	alias                         		24x7
	name                          		xi_timeperiod_24x7
	tuesday                       		00:00-24:00
	wednesday                     		00:00-24:00
	thursday                      		00:00-24:00
	friday                        		00:00-24:00
	saturday                      		00:00-24:00
	monday                        		00:00-24:00
	sunday                        		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		Never
	alias                         		No Time Is A Good Time
	}	

define timeperiod {
	timeperiod_name               		Non work hours
	alias                         		Non-Work Hours
	wednesday                     		00:00-08:30,17:30-24:00
	friday                        		00:00-08:30,17:30-24:00
	monday                        		00:00-08:30,17:30-24:00
	thursday                      		00:00-08:30,17:30-24:00
	tuesday                       		00:00-08:30,17:30-24:00
	sunday                        		00:00-24:00
	saturday                      		00:00-24:00
	}	

define timeperiod {
	timeperiod_name               		Working hours
	alias                         		Normal Work Hours
	friday                        		08:30-17:30
	thursday                      		08:30-17:30
	wednesday                     		08:30-17:30
	tuesday                       		08:30-17:30
	monday                        		08:30-17:30
	}	

###############################################################################
#
# Timeperiod configuration file
#
# END OF FILE
#
###############################################################################
Would be much appreciated for your help

Regards,
Steve
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Verify config file error after host added

Post by Box293 »

I believe this is the source of your problem:

/usr/local/nagios/etc/timeperiods.cfg

Code: Select all

define timeperiod {
   timeperiod_name                     eg xi_timeperiod_24x7
the eg in front should not be there.

You have a few like this, the eg should not be there.

Also, do you have Nagios XI? These look like Nagios XI configs but I'm confused because you've logged this in the Core support forum.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
steven.giang
Posts: 38
Joined: Tue May 12, 2015 3:08 am

Re: Verify config file error after host added

Post by steven.giang »

Thanks you Box293, that fixed the issue :)

However, there is another problem. Once I completed adding the first host. The ost does not appear on page "service detail" or "host detail" where UI giving an overview of the status.

But I can find the host and service locate on page CCM.

Very strange, and I must of missing something some setting after the upgrade. new host added does not appear in the overview details
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Verify config file error after host added

Post by tgriep »

When you added the new host and services, did you check the "Active" box to make it active?
If not, go back to CCM and edit them and check that box, save and apply the config.
Be sure to check out our Knowledgebase for helpful articles and solutions!
steven.giang
Posts: 38
Joined: Tue May 12, 2015 3:08 am

Re: Verify config file error after host added

Post by steven.giang »

tgriep wrote:When you added the new host and services, did you check the "Active" box to make it active?
If not, go back to CCM and edit them and check that box, save and apply the config.
Thanks you tgriep and box293, my issue have resolved after days of research. Getting more close up about Nagios now.

Thanks guys

Please moderate you can tick this topic as resolved
Locked