Tem um monte de tutoria por ai explicando com instalar o Nagios3. O problema é para quem nunca viu colocar os hosts para monitorar. Vou postar um pequeno aquivo de configuração bem simples, somente para monitorar por ip.
Dentro da pasta /etc/nagios3/conf.d é que estão os arquivos .cfg, ex. host.cfg que contem as informações do host a ser monitorado. O arquivo fica mais ou menos assim:
###############################################################################
# SERVIDOR (NOME FICTICIO DO SERVIDOR)
################################################################################
################################################################################
# DEFINICOES DE HOST (LOCAL ONDE SE DEFINE AS CONFIGURACOES DO HOST)
################################################################################
define host{
use generic-host
host_name HostX (aqui voce coloca o nome do host)
alias Cliente Empresarial (nome alternativo, pode ser o mesmo do host_name)
address 192.10.10.71 (ip do servidor a ser monitorado)
check_command check-host-alive
max_check_attempts 2
check_interval 1
notification_interval 30
notification_period 24x7
notification_options d,u,r
contact_groups admins
#parents Roteador Cisco (descomente esta linha se for usar o mapa, pois ela faz a ligação com outro host, só mudar o Roteador Cisco pelo host_name do servidor a quem ele se liga)
}
################################################################################
# DEFINICOES DE SERVICOS
################################################################################
################################################################################
# PING
################################################################################
define service{
host_name HostX (aqui voce coloca o nome do host igual o lá de cima, caso contrario, não funciona)
service_description PING
check_command check_ping!200.0,20%!600.0,60%
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
contact_groups admins
}
#################################################################################
Salve com a extensão .cfg dentro da pasta /etc/nagios3/conf.d
Re-inicie o nagios com o comando:
# /etc/init.d/nagios3 reload e depois /etc/init.d/nagios3 restart
Caso nenhum erro seja encontrado, ele volta a funcionar normalmente. Se alguma coisa estiver errada, ele vai dizer exatamente onde é. Dai só conferir e editar.
Dentro da pasta /etc/nagios3/conf.d é que estão os arquivos .cfg, ex. host.cfg que contem as informações do host a ser monitorado. O arquivo fica mais ou menos assim:
###############################################################################
# SERVIDOR (NOME FICTICIO DO SERVIDOR)
################################################################################
################################################################################
# DEFINICOES DE HOST (LOCAL ONDE SE DEFINE AS CONFIGURACOES DO HOST)
################################################################################
define host{
use generic-host
host_name HostX (aqui voce coloca o nome do host)
alias Cliente Empresarial (nome alternativo, pode ser o mesmo do host_name)
address 192.10.10.71 (ip do servidor a ser monitorado)
check_command check-host-alive
max_check_attempts 2
check_interval 1
notification_interval 30
notification_period 24x7
notification_options d,u,r
contact_groups admins
#parents Roteador Cisco (descomente esta linha se for usar o mapa, pois ela faz a ligação com outro host, só mudar o Roteador Cisco pelo host_name do servidor a quem ele se liga)
}
################################################################################
# DEFINICOES DE SERVICOS
################################################################################
################################################################################
# PING
################################################################################
define service{
host_name HostX (aqui voce coloca o nome do host igual o lá de cima, caso contrario, não funciona)
service_description PING
check_command check_ping!200.0,20%!600.0,60%
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 30
notification_period 24x7
notification_options w,c,r
contact_groups admins
}
#################################################################################
Salve com a extensão .cfg dentro da pasta /etc/nagios3/conf.d
Re-inicie o nagios com o comando:
# /etc/init.d/nagios3 reload e depois /etc/init.d/nagios3 restart
Caso nenhum erro seja encontrado, ele volta a funcionar normalmente. Se alguma coisa estiver errada, ele vai dizer exatamente onde é. Dai só conferir e editar.