Mudanças entre as edições de "NCPA"

De Slacam_Wiki
Ir para: navegação, pesquisa
(Criou página com ''''Instalando o NCPA para Check Passivo do Nagios''' 1 - Instalar o epel-release yum install epel-release -y 2 - Instalar o NCPA yum install ncpa -y 3 - Para verificar o se...')
 
 
(8 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
+
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
+
3 - Para verificar o serviço<br />
 
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 />
[nrdp]
+
[passive]<br />
parent = https://srvlupa.linea.gov.br/nrdp/
+
handlers = nrdp<br />
token = senhadeacesso
+
[nrdp]<br />
hostname = nomedoservidor
+
parent = https://srvlupa.linea.gov.br/nrdp/<br />
[plugin directives]
+
token = senhadeacesso<br />
# Plugin path where all plugins will be ran from.¬
+
hostname = nomedoservidor<br />
plugin_path = /usr/lib64/nagios/plugins/¬
+
[plugin directives]<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
+
vim /usr/local/ncpa/etc/ncpa.cfg.d/monitor.cfg<br />
  
7 - Colocar as entradas:
+
7 - Colocar as entradas:<br />
[passive checks]¬
+
[passive checks]<br />
¬
+
%HOSTNAME%|__HOST__ = system/agent_version<br />
%HOSTNAME%|__HOST__ = system/agent_version
+
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg<br />
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
+
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi<br />
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
+
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi<br />
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
+
%HOSTNAME%|Process Count = processes --warning 300 --critical 400<br />
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
+
%HOSTNAME%|Root Disk Usage = disk/logical/|/used_percent --warning 80 --critical 90<br />
%HOSTNAME%|Root Disk Usage = disk/logical/|/used_percent --warning 80 --critical 90
+
%HOSTNAME%|Uptime = plugins/check_uptime<br />
%HOSTNAME%|Uptime = plugins/check_uptime
+
%HOSTNAME%|Conected Users = plugins/check_users/-w/5/-c/10<br />
%HOSTNAME%|Conected Users = plugins/check_users/-w/5/-c/10
+
 
 +
 
 +
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

}