Mudanças entre as edições de "NCPA"
(7 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
Linha 1: | Linha 1: | ||
'''Instalando o NCPA para Check Passivo do Nagios''' | '''Instalando o NCPA para Check Passivo do Nagios''' | ||
− | 1 - Instalar o epel-release | + | 1 - Instalar o epel-release<br /> |
yum install epel-release -y | yum install epel-release -y | ||
− | 2 - Instalar o NCPA | + | 2 - Instalar o NCPA<br /> |
− | yum install ncpa -y<br /> | + | Baixar o o pacote em:<br /> |
+ | wget https://assets.nagios.com/downloads/ncpa/ncpa-2.1.6.el7.x86_64.rpm<br /> | ||
+ | yum install ncpa -y<br /><br /> | ||
− | + | 3 - Para verificar o serviço<br /> | |
− | 3 - Para verificar o serviço | + | |
systemctl status ncpa_passive | systemctl status ncpa_passive | ||
− | 4 - Editar o arquivo de configuração: | + | 4 - Editar o arquivo de configuração:<br /> |
vim /usr/local/ncpa/etc/ncpa.cfg | vim /usr/local/ncpa/etc/ncpa.cfg | ||
− | 5 - Colocar as info de check passivo para o daemon | + | 5 - Colocar as info de check passivo para o daemon<br /> |
+ | [passive]<br /> | ||
+ | handlers = nrdp<br /> | ||
[nrdp]<br /> | [nrdp]<br /> | ||
parent = https://srvlupa.linea.gov.br/nrdp/<br /> | parent = https://srvlupa.linea.gov.br/nrdp/<br /> | ||
Linha 20: | Linha 23: | ||
hostname = nomedoservidor<br /> | hostname = nomedoservidor<br /> | ||
[plugin directives]<br /> | [plugin directives]<br /> | ||
− | |||
plugin_path = /usr/lib64/nagios/plugins/<br /> | plugin_path = /usr/lib64/nagios/plugins/<br /> | ||
− | 6 - Configurar quais os checks serão feitos no host | + | 6 - Configurar quais os checks serão feitos no host<br /> |
vim /usr/local/ncpa/etc/ncpa.cfg.d/monitor.cfg<br /> | vim /usr/local/ncpa/etc/ncpa.cfg.d/monitor.cfg<br /> | ||
− | 7 - Colocar as entradas: | + | 7 - Colocar as entradas:<br /> |
[passive checks]<br /> | [passive checks]<br /> | ||
%HOSTNAME%|__HOST__ = system/agent_version<br /> | %HOSTNAME%|__HOST__ = system/agent_version<br /> | ||
Linha 36: | Linha 38: | ||
%HOSTNAME%|Uptime = plugins/check_uptime<br /> | %HOSTNAME%|Uptime = plugins/check_uptime<br /> | ||
%HOSTNAME%|Conected Users = plugins/check_users/-w/5/-c/10<br /> | %HOSTNAME%|Conected Users = plugins/check_users/-w/5/-c/10<br /> | ||
+ | |||
+ | |||
+ | 8 - Configurar o serviço de NRDP no Servidor Nagios<br /> | ||
+ | |||
+ | define host { | ||
+ | use generic-host | ||
+ | name passive_host | ||
+ | active_checks_enabled 0 | ||
+ | passive_checks_enabled 1 | ||
+ | flap_detection_enabled 0 | ||
+ | register 0 | ||
+ | check_period 24x7 | ||
+ | max_check_attempts 1 | ||
+ | check_interval 5 | ||
+ | retry_interval 1 | ||
+ | check_freshness 1 | ||
+ | freshness_threshold 300 | ||
+ | check_command check_dummy!2 | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | use generic-service | ||
+ | name passive_service | ||
+ | active_checks_enabled 0 | ||
+ | passive_checks_enabled 1 | ||
+ | flap_detection_enabled 1 | ||
+ | register 0 | ||
+ | check_period 24x7 | ||
+ | max_check_attempts 1 | ||
+ | check_interval 5 | ||
+ | retry_interval 1 | ||
+ | check_freshness 1 | ||
+ | freshness_threshold 300 | ||
+ | check_command check_dummy!2 | ||
+ | } | ||
+ | |||
+ | 9 - Modelo de configuração de Check de Host e Services<br /> | ||
+ | |||
+ | define host{ | ||
+ | use passive_host | ||
+ | host_name webbackpassive | ||
+ | alias Servidor Teste Passive | ||
+ | parents gwicx | ||
+ | icon_image centos.gif | ||
+ | vrml_image centos.png | ||
+ | statusmap_image centos.gd2 | ||
+ | contact_groups admins | ||
+ | notification_period 24x7 | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | use passive_service | ||
+ | contact_groups admins | ||
+ | service_description CPU Usage | ||
+ | host_name webbackpassive | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | use passive_service | ||
+ | contact_groups admins | ||
+ | service_description Root Disk Usage | ||
+ | host_name webbackpassive | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | use passive_service | ||
+ | contact_groups admins | ||
+ | service_description Swap Usage | ||
+ | host_name webbackpassive | ||
+ | } |
Edição atual tal como às 15h55min de 1 de março de 2019
Instalando o NCPA para Check Passivo do Nagios
1 - Instalar o epel-release
yum install epel-release -y
2 - Instalar o NCPA
Baixar o o pacote em:
wget https://assets.nagios.com/downloads/ncpa/ncpa-2.1.6.el7.x86_64.rpm
yum install ncpa -y
3 - Para verificar o serviço
systemctl status ncpa_passive
4 - Editar o arquivo de configuração:
vim /usr/local/ncpa/etc/ncpa.cfg
5 - Colocar as info de check passivo para o daemon
[passive]
handlers = nrdp
[nrdp]
parent = https://srvlupa.linea.gov.br/nrdp/
token = senhadeacesso
hostname = nomedoservidor
[plugin directives]
plugin_path = /usr/lib64/nagios/plugins/
6 - Configurar quais os checks serão feitos no host
vim /usr/local/ncpa/etc/ncpa.cfg.d/monitor.cfg
7 - Colocar as entradas:
[passive checks]
%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
%HOSTNAME%|Root Disk Usage = disk/logical/|/used_percent --warning 80 --critical 90
%HOSTNAME%|Uptime = plugins/check_uptime
%HOSTNAME%|Conected Users = plugins/check_users/-w/5/-c/10
8 - Configurar o serviço de NRDP no Servidor Nagios
define host {
use generic-host name passive_host active_checks_enabled 0 passive_checks_enabled 1 flap_detection_enabled 0 register 0 check_period 24x7 max_check_attempts 1 check_interval 5 retry_interval 1 check_freshness 1 freshness_threshold 300 check_command check_dummy!2
}
define service {
use generic-service name passive_service active_checks_enabled 0 passive_checks_enabled 1 flap_detection_enabled 1 register 0 check_period 24x7 max_check_attempts 1 check_interval 5 retry_interval 1 check_freshness 1 freshness_threshold 300 check_command check_dummy!2
}
9 - Modelo de configuração de Check de Host e Services
define host{
use passive_host host_name webbackpassive alias Servidor Teste Passive parents gwicx icon_image centos.gif vrml_image centos.png statusmap_image centos.gd2 contact_groups admins notification_period 24x7 }
define service {
use passive_service contact_groups admins service_description CPU Usage host_name webbackpassive
}
define service {
use passive_service contact_groups admins service_description Root Disk Usage host_name webbackpassive
}
define service {
use passive_service contact_groups admins service_description Swap Usage host_name webbackpassive
}