New Nagios 4.4.5 installation is failing

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
franchise036
Posts: 4
Joined: Tue Aug 07, 2018 11:30 am

New Nagios 4.4.5 installation is failing

Post 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.
--
Attachments
SCServers.cfg.txt
(95.44 KiB) Downloaded 101 times
SCServers-RTP.cfg.txt
(29.91 KiB) Downloaded 103 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: New Nagios 4.4.5 installation is failing

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
franchise036
Posts: 4
Joined: Tue Aug 07, 2018 11:30 am

Re: New Nagios 4.4.5 installation is failing

Post by franchise036 »

I can figure out the syntax for this and what file to put it in??
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: New Nagios 4.4.5 installation is failing

Post 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
}
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
franchise036
Posts: 4
Joined: Tue Aug 07, 2018 11:30 am

Re: New Nagios 4.4.5 installation is failing

Post 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]#
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: New Nagios 4.4.5 installation is failing

Post by scottwilkerson »

Did you add the definition example above to a file that is included in the configs?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
franchise036
Posts: 4
Joined: Tue Aug 07, 2018 11:30 am

Re: New Nagios 4.4.5 installation is failing

Post by franchise036 »

I have added to the SCServers.cfg file what was to be added but nothing changed.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: New Nagios 4.4.5 installation is failing

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked