Servidor de monitoramento Nagios
Imagine poder monitorar todos seus servidores, clientes, impressoras, roteadores e switches em um único servidor e serviço. Receber relatórios por e-mail, celular, bem como saber quantas vezes um servidor ficou fora do ar e voltou a funcionar.
Parte 5: Arquivo switch.cfg
Neste arquivo você configura para monitorar roteadores, switches na rede, a sintaxe é idêntica ao arquivo anterior, com suas devidas seções.
# HOST DEFINITIONS - Definições de nome, ip, alias, grupo
# Define the switch that we'll be monitoring
define host{
use generic-switch ; Inherit default values from a template
host_name roteador_espanha ; The name we're giving to this switch
alias Roteador espanha ; A longer name associated with the switch
address 192.168.75.5 ; IP address of the switch
hostgroups roteadores ; Host groups this switch is associated with
}
# HOST GROUP DEFINITIONS - Definições de grupo, nome.
# Create a new hostgroup for switches
define hostgroup{
hostgroup_name roteadores ; The name of the hostgroup
alias Roteadores ; Long name of the group
}
# SERVICE DEFINITIONS - Definição de serviços
# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name roteador_botafogo ; The name of the host the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
# Define the switch that we'll be monitoring
define host{
use generic-switch ; Inherit default values from a template
host_name roteador_espanha ; The name we're giving to this switch
alias Roteador espanha ; A longer name associated with the switch
address 192.168.75.5 ; IP address of the switch
hostgroups roteadores ; Host groups this switch is associated with
}
# HOST GROUP DEFINITIONS - Definições de grupo, nome.
# Create a new hostgroup for switches
define hostgroup{
hostgroup_name roteadores ; The name of the hostgroup
alias Roteadores ; Long name of the group
}
# SERVICE DEFINITIONS - Definição de serviços
# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name roteador_botafogo ; The name of the host the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
Parabéns!!!