thinomar
(usa Linux Mint)
Enviado em 12/11/2015 - 17:25h
Primeiro você tem que instalar o NRPE nas máquinas que forem monitoradas. Se forem Windows, instale o NSClient++ nelas. Em seguida, basta criar arquivos para os hosts e adicionar o caminho dos mesmos no /usr/local/nagios/etc/nagios.cfg. Exemplo de arquivo:
### DEFINIÇÕES DE HOST ###
define host{
use generic-host
host_name MCX
alias Meu host linds
address 192.168.100.45
check_command check-host-alive
max_check_attempts 2
check_interval 1
# parents FIREWALL
notification_interval 1
notification_period 24x7
notification_options d,u,r
contact_groups admins
}
# ICONE #
#define hostextinfo{
# host_name MCX
# icon_image server4.png
# icon_image_alt MCX
# vrml_image server4.png
# statusmap_image server4.png
#}
### PING ###
define service{
use generic-service,graphed-service
host_name MCX
service_description Ping
check_command check_ping!5000.0,80%!8000.0,100%
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
notifications_enabled 0
}
### ESPAÇO EM DISCO ###
define service{
use generic-service,graphed-service
host_name MCX
service_description Espaco em disco
check_command check_nrpe!check_disk
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### TOTAL DE PROCESSOS ###
define service {
use generic-service,graphed-service
host_name MCX
service_description Processos
check_command check_nrpe!check_procs!300!350
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### QNTD. USUARIOS LOGADOS ###
define service {
use generic-service,graphed-service
host_name MCX
service_description Usuarios
check_command check_nrpe!check_users!3!6
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### CPU ###
define service {
use generic-service
host_name MCX
service_description CPU Load
check_command check_nrpe!check_load!80%!90%
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### SSH ###
define service {
use generic-service
host_name MCX
service_description SSH
check_command check_ssh
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### UPTIME ###
define service {
use generic-service
host_name MCX
service_description Uptime
check_command check_nrpe!check_uptime!1051200!10512000
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
### SWAP ###
define service {
use generic-service
host_name MCX
service_description Swap
check_command check_nrpe!check_swap!50%!40%
max_check_attempts 2
normal_check_interval 1
retry_check_interval 1
check_period 24x7
notification_interval 120
notification_period 24x7
notification_options w,c,r
contact_groups admins
notifications_enabled 0
}
--
-I've been talking to the main computer
-And...?
-It hates me