Estou tentando adicionar um host ao meu servidor Nagios Core se ele verifica sua disponibilidade da mesma forma que você verifica no Nagios XI, então crio meu .cfg
arquivo, adiciono as informações do host e tento verificar o arquivo .cfg, mas a cada sempre que executo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
recebo o seguinte erro:
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Invalid max_check_attempts value for host 'myhost.com'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/webpages.cfg', starting on line 7)
Error processing object config files!
***> One or more problems were 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.
meu webpages.cfg
arquivo está assim:
#########################################
# #
# Hosts #
# #
#########################################
define host {
use generic-host
host_name myhost.com
alias myhost
check_interval 1
address xxx.xxx.xxx.xxx
}
#########################################
# #
# Services #
# #
#########################################
define service {
host_name myhost.com
service_description URL: myhost.com
check_command check_http_url!http://myhost.com
max_check_attempts 5
check_interval 3
retry_interval 1
check_period 24x7
Seu modelo
generic-host
provavelmente não incluimax_check_attempts
a configuração manual, poismax_check_attempts
é um atributo obrigatório.BTW: Você nunca deve reiniciar o Nagios sem testar a configuração usando o parâmetro -v