Monitoração de Hosts e Serviços com o NAGIOS
Uma das maiores dificuldades de administradores de redes em ambientes com S.O.´s diversificados e críticos, é a monitoração de hosts e serviços. Por isso, elaboramos um artigo que visa ir um pouco mais a fundo na configuração do Nagios, ajudando iniciantes e experientes a tirar proveito desta consagrada ferramenta.
[ Hits: 123.479 ]
Por: Gilberto Russo em 23/09/2006
define timeperiod{
timeperiod_name 24x7
alias 24 Horas por dia/7 dias da semana
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
define contact {
contact_name ronaldo
alias Ronaldo Gomes
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notificacao-por-email
host_notification_commands host-notificacao-por-email
email ronaldo.gomes@seu_email.com.br
}
define contactgroup {
contactgroup_name tecnicos
alias Técnicos Empresa
members ronaldo
}
define host{
name host-padrao
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}
define host{
use host-padrao
host_name host-linux-firewall
alias Servidor Firewall
address 172.16.32.1
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define host{
use host-padrao
host_name host-linux-dns
alias Servidor DNS Interno
address 172.16.32.2
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define host{
use host-padrao
host_name host-linux-mta
alias Servidor MTA
address 172.16.32.3
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define host{
use host-padrao
host_name host-linux-web
alias Servidor Web
address 172.16.32.4
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define host{
use host-padrao
host_name host-linux-nagios
alias Servidor de Monitoramento-Nagios
address 172.16.32.100
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define host{
use host-padrao
host_name host-win-web
alias Servidor Web (IIS)
address 172.16.32.5
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
contact_groups tecnicos
}
define hostgroup{
hostgroup_name Roteador
alias Máquinas Gateways
members host-linux-firewall
}
define hostgroup{
hostgroup_name Servidores Linux
alias Servidores Empresa
members host-linux-dns,host-linux-mta,
host-linux-web,host-linux-nagios
}
define hostgroup{
hostgroup_name Servidores Windows
alias Servidores Empresa
members host-win-web
}
# Template de Serviços
define service{
name service-padrao
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
register 0
}
# Checando se todas as máquinas estão ativas.
# PING Protocolo ICMP)
define service{
use service-padrao
host_name *
service_description Host Ativo
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!100.0,20%!500.0,60%
}
##### Monitoramento Servidor Nagios - LocalHost #######
# Monitorando Espaço em Disco
define service{
use service-padrao
host_name host-linux-nagios
service_description Tamanho em Disco
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_disk!20%!10%!/
}
# Monitorando Quantidade de Usuários Logados
define service{
use service-padrao
host_name host-linux-nagios
service_description Usuarios Logados
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_users!20!50
}
# Monitorando quantidade de Processos Ativos
define service{
use service-generic
host_name host-linux-nagios
service_description Processos Ativos
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_procs!250!400
}
####### Monitorando Serviços da Rede #########
# Serviço HTTP (Protocolo TCP, Porta 80)
define service{
use service-padrao
host_name host-linux-web,host-win-web
service_description Servidor HTTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}
# Serviço NAMED (Protocolo UDP, Porta 53)
define service{
use service-padrao
host_name host-linux-dns
service_description Servidor DNS
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_dns
}
# Serviço SMTP (Porta 25)
define service{
use service-padrao
host_name host-linux-mta
service_description Servidor SMTP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
}
# Serviço POP (Porta 110)
define service{
use service-padrao
host_name host-linux-mta
service_description Servidor POP3
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_pop
}
# Serviço IMAP (Porta 143)
define service{
use service-padrao
host_name host-linux-mta
service_description Servidor IMAP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups tecnicos
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_imap
}
define hostextinfo{
name linux-template
icon_image linux40.png
icon_image_alt SO Linux
vrml_image linux40.png
gd2_image linux40.gd2
register 0
}
define hostextinfo{
name windows-template
icon_image win40.png
icon_image_alt SO Windows
vrml_image win40.png
gd2_image win40.gd2
register 0
}
define hostextinfo{
use linux-template
host_name host-linux-firewall,host-linux-dns,host-linux-mta
2d_coords 65,425
3d_coords 3.0,0.0,0.0
}
define hostextinfo{
use windows-template
host_name host-win-web
2d_coords 65,425
3d_coords 3.0,0.0,0.0
}
define serviceextinfo {
host_name host-win-web,host-linux-web
service_description Servidor HTTP
notes_url www.apache.org
icon_image world.gif
icon_image_alt web
}
Proxy reverso e balanceamento de carga utilizando o Pound
Osiris - Integridade do sistema de arquivos
KnowledgeTree - Um Gerenciador Eletrônico de Documentos funcional
Firewalls redundantes utilizando VRRP
Acesso remoto utilizando FreeNX
Instalação do Asterisk - Distribuição Trixbox
Configurando a mudança de brilho no Notebook Vostro 1000 da Dell
file-rc - gerenciando a inicialização de serviços
Resolvendo problemas na rede do Slackware
Servidor web nginx com PHP-FPM e memcached
Cirurgia para acelerar o openSUSE em HD externo via USB
Void Server como Domain Control
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Como implementar Raid (0, 1, 5, 6, 10 e 50)
fusermount3 no Ubuntu 25.10 - mantenha o perfil do AppArmor
[Resolvido] dlopen(): error loading libfuse.so.2 AppImages require FUSE to run.
Criação de diretórios e aplicação de restrições de acesso no Linux
Como programar um sistema de controle para distribuições linux em c? (1)
Compartilhar ZEBRA ZD220 na rede (2)
Como programar um software que seja utilizado para coleta de dados em ... (1)









