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.336 ]
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
}
ISCSI - Um sistema de transferência de arquivos diferente
Acesso remoto utilizando FreeNX
Osiris - Integridade do sistema de arquivos
Proxy reverso e balanceamento de carga utilizando o Pound
Configuração do DKIM no Debian com Postfix e Múltiplos Domínios
Recuperando e/ou adaptando o GRUB do Sabayon Linux
Configurando Linux para Desenvolvimento de Sites
Tutorial de Instalação do Redmine
Configuração: Servidor de nomes slave com Bind9 no Debian 4.0
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Atualizando o Fedora 42 para 43
Como saber se o seu e-mail já teve a senha vazada?
Como descobrir se a sua senha já foi vazada na internet?
\Boot sem espaço em disco (Fedora KDE Plasma 42) (4)
Preciso recuperar videos *.mp4 corrompidos (0)
Programa fora de escala na tela do pc (38)









