I got nagios installed and used the default files to just add one host just to see what nagios is all about. ok, that worked fine.
I am trying to define templates now so I can dump all of the machines out of AD, write the windows.cfg file with a script and have templated groups that they will all fall into, so I don't have to specify everything for each host manually.
I made a bunch of updates to the templates.cfg file, and some to the contacts.cfg file. However, its the localhost.cfg file that is throwing the errors and I cannot understand why.
Error: Invalid max_check_attempts value for host 'localhost'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 24)
Error processing object config files!
Code: Select all
# Define a host for the local machine
define host{
# use linux-servers ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################
# Define an optional hostgroup for Linux machines
#define hostgroup{
# hostgroup_name linux-servers ; The name of the hostgroup
# alias Linux Servers ; Long name of the group
# members localhost ; Comma separated list of hosts that belong to this group
# }
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
define service{
name local-service ; The name of this service template
[b]max_check_attempts 4 [/b] ; Re-check the service up to 4 times in order to determine its final (hard) state
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until a hard state can be determined
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
Code: Select all
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Swap Usage
check_command check_local_swap!20!10
}
I have not defined this host or templated service anywhere in the templates.cfg as this is just the localhost and the values i think are what nagios came with in the sample so I can't understand why this is an error. What am I missing?