I'm unable to start nagios.service and upon checking its status I get the message below.
How do I do "Check your configuration file(s) to ensure that they contain valid"?
thanks,
ik
[root@nagioscore ~]# systemctl status nagios.service
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-10-12 14:00:08 EDT; 1min 15s ago
Docs: man:systemd-sysv-generator(8)
Process: 5971 ExecStop=/etc/rc.d/init.d/nagios stop (code=exited, status=0/SUCCESS)
Process: 6047 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=8)
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: Check your configuration file(s) to ensure that they contain valid
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: directives and data definitions. If you are upgrading from a previous
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: version of Nagios, you should be aware that some variables/definitions
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: may have been removed or modified in this version. Make sure to read
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: the HTML documentation regarding the config files, as well as the
Oct 12 14:00:08 nagioscore.localdomain nagios[6047]: 'Whats New' section to find out what has changed.
Oct 12 14:00:08 nagioscore.localdomain systemd[1]: nagios.service: control process exited, code=exited status=8
Oct 12 14:00:08 nagioscore.localdomain systemd[1]: Failed to start LSB: Starts and stops the Nagios monitoring server.
Oct 12 14:00:08 nagioscore.localdomain systemd[1]: Unit nagios.service entered failed state.
Oct 12 14:00:08 nagioscore.localdomain systemd[1]: nagios.service failed.
Check your configuration file to ensure they are valid?
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Check your configuration file to ensure they are valid?
Hi, @ikekim. What did you do prior to this error? Did you upgrade the core or did you try to add new hosts, services, etc ? Usually i'd start from checking the nagios.cfg file. You can also run the following command to troubleshoot configuration problems:
If it shows any errors please post the whole output here, as well as your nagios.cfg file.
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Check your configuration file to ensure they are valid?
thanks for that command. here is the output.
My iis.cfg file content is:
I'm trying to add and define the host with minimal info just to get my very first host & service to appear on Nagios Core web page.
thanks.
Code: Select all
[root@nagioscore etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any hostgroup matching 'allhosts' (config file '/usr/local/nagios/etc/objects/iis.cfg', starting on line 1)
Error: Failed to process hostgroup names for host 'registration_iis' (config file '/usr/local/nagios/etc/objects/iis.cfg', starting at line 1)
Error: Invalid max_check_attempts value for host 'registration_iis'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/iis.cfg', starting on line 1)
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.
My iis.cfg file content is:
Code: Select all
define host {
use generic-host
host_name registration_iis
alias Some Remote Host
address 10.155.58.26
hostgroups allhosts
}
thanks.
Last edited by dwhitfield on Thu Oct 12, 2017 4:25 pm, edited 1 time in total.
Reason: code blocks FTW
Reason: code blocks FTW
Re: Check your configuration file to ensure they are valid?
Hi @ikekim
You have an error in your object definition:
Change: To:
Please take a look at Object Definitions
Let us know if you have any questions.
You have an error in your object definition:
Code: Select all
define host {
use generic-host
host_name registration_iis
alias Some Remote Host
address 10.155.58.26
hostgroups allhosts
}
Code: Select all
hostgroups allhosts
Code: Select all
hostgroup_name allhosts
Let us know if you have any questions.
Re: Check your configuration file to ensure they are valid?
After going through your response, it looks like I need this, but what file name do I use for this content and where do I place the file?
define hostgroup{
hostgroup_name hostgroup_name
alias alias
members hosts
hostgroup_members hostgroups
notes note_string
notes_url url
action_url url
}
For now I removed the "hostgroup" reference from the iis.cfg file and then I had to add "max_check_attempts 5" in the iis.cfg file.
That got rid of the error.
thanks,
ik
define hostgroup{
hostgroup_name hostgroup_name
alias alias
members hosts
hostgroup_members hostgroups
notes note_string
notes_url url
action_url url
}
For now I removed the "hostgroup" reference from the iis.cfg file and then I had to add "max_check_attempts 5" in the iis.cfg file.
That got rid of the error.
thanks,
ik
Re: Check your configuration file to ensure they are valid?
Glad it worked for you.
I am now going to close this thread as resolved.
Please let us know if you have any other questions.
I am now going to close this thread as resolved.
Please let us know if you have any other questions.