Page 1 of 1

New Nagios 4.4.5 installation is failing

Posted: Wed Jan 15, 2020 3:36 pm
by franchise036
I am standing up a new installation of Nagios Core 4.4.5 on a RHEL 7 server to monitor all our RHEL 7 servers.
I am getting the error below and have attached my config files
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Jan 15 15:13:11 rhel7workdd.rtord.epa.gov systemd[1]: Starting Nagios Core 4.4.5...
-- Subject: Unit nagios.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit nagios.service has begun starting up.
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Nagios Core 4.4.5
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Copyright (c) 2009-present Nagios Core Development Team and Community Contribu
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Copyright (c) 1999-2009 Ethan Galstad
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Last Modified: 2019-08-20
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: License: GPL
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Website: https://www.nagios.org
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Reading configuration data...
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Read main config file okay...
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error: Template 'SCServer' specified in host definition could not be not found
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error: Invalid max_check_attempts value for host 'rhel7workdd.rtord.epa.gov'
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error: Could not register host (config file '/usr/local/nagios/etc/objects/loc
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error processing object config files!
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: ***> One or more problems was encountered while processing the config files...
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Check your configuration file(s) to ensure that they contain valid
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: directives and data definitions. If you are upgrading from a previous
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: version of Nagios, you should be aware that some variables/definitions
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: may have been removed or modified in this version. Make sure to read
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: the HTML documentation regarding the config files, as well as the
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: 'Whats New' section to find out what has changed.
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov systemd[1]: nagios.service: control process exited, code=exited status=1
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov systemd[1]: Failed to start Nagios Core 4.4.5.
-- Subject: Unit nagios.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit nagios.service has failed.
--

Re: New Nagios 4.4.5 installation is failing

Posted: Wed Jan 15, 2020 3:46 pm
by scottwilkerson
Let's dissect these two lines in the error


SCServer
franchise036 wrote:

Code: Select all

Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error: Template 'SCServer' specified in host definition could not be not found
Jan 15 15:13:11 rhel7workdd.rtord.epa.gov nagios[28413]: Error: Invalid max_check_attempts value for host 'rhel7workdd.rtord.epa.gov'
the first line states that the template SCServer can not be found. This template is defined to be used in many of the host definitions you have in SCServers-RTP.cfg.txt but neither of the files you posted contain a definition for SCServer and it appears that nagios cannot find it as well.

I would suspect that that template would contain the max_check_attempts that is missing from all of your definitions.

Re: New Nagios 4.4.5 installation is failing

Posted: Thu Jan 16, 2020 10:13 am
by franchise036
I can figure out the syntax for this and what file to put it in??

Re: New Nagios 4.4.5 installation is failing

Posted: Thu Jan 16, 2020 10:25 am
by scottwilkerson
franchise036 wrote:I can figure out the syntax for this and what file to put it in??
It should looks something like this and can go in any file that is included in the config

Code: Select all

define service {
    name                            SCServer
    max_check_attempts              5
    check_interval                  10
    retry_interval                  2
    check_period                    24x7
    check_freshness                 0
    notification_interval           60
    notification_period             24x7
    notifications_enabled           1
    register                        0
}

Re: New Nagios 4.4.5 installation is failing

Posted: Thu Jan 16, 2020 11:06 am
by franchise036
[root@rhel7workdd ORD]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.4.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-08-20
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Template 'SCServer' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/ORD/SCServers-RTP.cfg', starting on line 836)
Error: Invalid max_check_attempts value for host 'rhel7workdd.rtord.epa.gov'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 24)
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.

[root@rhel7workdd ORD]#

Re: New Nagios 4.4.5 installation is failing

Posted: Thu Jan 16, 2020 1:34 pm
by scottwilkerson
Did you add the definition example above to a file that is included in the configs?

Re: New Nagios 4.4.5 installation is failing

Posted: Wed Feb 05, 2020 11:04 am
by franchise036
I have added to the SCServers.cfg file what was to be added but nothing changed.

Re: New Nagios 4.4.5 installation is failing

Posted: Wed Feb 05, 2020 6:42 pm
by Box293
franchise036 wrote:Error: Template 'SCServer' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/ORD/SCServers-RTP.cfg', starting on line 836)
You need a host template defined called 'SCServer'.

The default config has a templates.cfg file that you can find an example template to copy and turn into the missing template.