• Nagios no Suse 11

    nagios-logo-pequenoO Nagios ainda é um das soluções bem usadas no mundo Open Source para monitoramento de redes.
    Após um boa pesquisa e ajuda de amigos desenvolvemos um tutorial com uma instalação tão simples que até desconfiamos. Mas veja, analise, faça a instalação conforme nosso tutorial, e verás que realmente instalar o Nagios no Suse da Novell é muito fácil.

    Ambiente do laboratório
    Esse guia de instalação foi desenvolvido apenas para a versão 11 do SuSe Linux Enterprise Server, pois tive essa demanda, fui em busca de amigos que me ajudaram bastante e também muita informação na net.
    Para que o seu cenário fique parecido com o que vou demonstrar, irei lhe dar algumas informações.
    Sistema operacional: SuSe Linux Enterprise Server 11 – SP1, baixado do site da Novell.
    Configuração do hardware: Máquina virtual (VirtualBox em cima do Ubuntu 10.10) com as configurações de 2 GB de memória – 1 Processador – 30 Gb de disco – 1 placa de rede – placa de vídeo com 12 mb que é o padrão da VM, não habilitei som, portas seriais, pastas compartilhadas e como não há SLES com template no Virtual Box, usei o template do OpenSuse .

    Nesse tutorial, não vamos abordar instalação e configuração do SuSe, apenas a instalação básica do Nagios Core.

    Mãos à obra .

    Verificações pré instalação
    Se você verificar, o próprio sistema já possue um Nagios pré-configurado, pronto para ser instalado, veja digitando na console.
    # zypper se nagios

    Resultado do comando:
    Loading repository data…
    Reading installed packages…

    S  | Name                    | Summary | Type
    –+——————————+————————————————–+———– ——————–|
    | nagios                       | The Nagios Network Monitor               | package
    | nagios                       | The Nagios Network Monitor               | srcpackage
    | nagios-nsca               | The Nagios Service Check Acceptor      | package
    | nagios-nsca               | The Nagios Service Check Acceptor | srcpackage
    | nagios-nsca-client      | The Nagios Service Check Acceptor Cli-> | package
    | nagios-plugins           | The Nagios Plug-Ins                             | package
    | nagios-plugins           | The Nagios Plug-Ins                             | srcpackage
    | nagios-plugins-extras | Nagios Plug-Ins which depend on addit-> | package
    | nagios-plugins-nis     | Nagios plugin to check the status of ->  | package
    | nagios-plugins-nis     | Nagios plugin to check the status of ->  | srcpackage
    | nagios-plugins-rsync | Nagios plugin for checking rsync serv-> | package
    | nagios-plugins-rsync | Nagios plugin for checking rsync serv-> | srcpackage
    | nagios-www             | Provides the HTML and CGI files for t-> | package

    Porém esse é antigo e queremos instalar o mais recente não é, mas veja a versão que vem no sistema.
    # zypper info nagios
    Resultado do comando:

    Loading repository data…
    Reading installed packages…
    Information for package nagios:
    Repository: SUSE-Linux-Enterprise-Server-11-SP1 11.1.1-1.152
    Name: nagios
    Version: 3.0.6-1.21.1
    Arch: i586
    Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
    Support Level: Level 3
    Installed: No
    Status: not installed
    Installed Size: 4.2 MiB
    Summary: The Nagios Network Monitor
    Description:
    Nagios is a program that will monitor hosts and services on yournetwork. It has the ability to email or page you when a problem arisesand when a problem is resolved. Nagios is written in C and isdesigned to run under Linux (and some other *NIX variants) as abackground process, intermittently running checks on various servicesthat you specify.
    The actual service checks are performed by separate “plugin” programswhich return the status of the checks to Nagios. The plugins areavailable at http://sourceforge.net/projects/nagiosplug
    This package provide core programs for nagios. The web interface,documentation, and development files are built as separate packages

    Vamos adicionar um novo repositório no SuSe,

    digite os comandos abaixo em negrito ;

    # zypper ar http://download.opensuse.org/repositories/server:/monitoring/SLE_11.1 monitoring

    Resultado do comando:

    Adding repository ‘monitoring’ [done]
    Repository ‘monitoring’ successfully added
    Enabled: Yes
    Autorefresh: No
    URI: http://download.opensuse.org/repositories/server:/monitoring/SLE_11.1

    # zypper ref

    Resultado do comando:
    Retrieving repository ‘monitoring’ metadata [\]
    New repository or package signing key received:
    Key ID: A5C23697EE454F98
    Key Name: server:monitoring OBS Project <server: monitoring@build.opensuse.orgEste endereço de e-mail está protegido contra spambots. Você deve habilitar o JavaScript para visualizá-lo. >
    Key Fingerprint: 8F3BC8EFF549CDCDA918D981A5C23697EE454F98
    Repository: monitoring

    – digite a para aceitar

    Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a

    Resultado do comando:

    Retrieving repository ‘monitoring’ metadata [done]
    Building repository ‘monitoring’ cache [done]
    All repositories have been refreshed.

    Agora, olhe como foi adicionado mais opções pro Nagios no Yast.

    # zypper se nagios

    Resultado do comando:

    Loading repository data…
    Reading installed packages…
    S | Name | Summary | Type
    –+———————————+————————————–+———– —————–
    | nagios | The Nagios Network Monitor | package
    | nagios | The Nagios Network Monitor | srcpackage
    | nagios-debuginfo | Debug information for package nagios | package
    | nagios-debugsource | Debug sources for package nagios | package
    | nagios-devel | Development files for nagios | package
    | nagios-nrpe | Nagios Remote Plug-In Executor | package
    | nagios-nrpe | Nagios Remote Plug-In Executor | srcpackage
    | nagios-nrpe-debuginfo | Debug information for package nagi-> | package
    | nagios-nrpe-debugsource | Debug sources for package nagios-n-> | package
    | nagios-nrpe-doc | Nagios Remote Plug-In Executor doc-> | package
    | nagios-nsca | The Nagios Service Check Acceptor | package
    | nagios-nsca | The Nagios Service Check Acceptor | srcpackage
    | nagios-nsca-client | The Nagios Service Check Acceptor -> | package
    | nagios-nsca-debuginfo | Debug information for package nagi-> | package
    | nagios-nsca-debugsource | Debug sources for package nagios-n-> | package
    | nagios-plugins | The Nagios Plug-Ins | package
    | nagios-plugins | The Nagios Plug-Ins | srcpackage
    | nagios-plugins-arcconf | Nagios plugin for checking Adaptec-> | package
    | nagios-plugins-arcconf | Nagios plugin for checking Adaptec-> | srcpackage
    | nagios-plugins-bonding | Nagios Network Bonding Check | package
    | nagios-plugins-bonding | Nagios Network Bonding Check | srcpackage
    | nagios-plugins-debuginfo | Debug information for package nagi-> | package
    | nagios-plugins-debugsource | Debug sources for package nagios-p-> | package
    | nagios-plugins-drbd | Checks the state of DRBD devices | package
    | nagios-plugins-drbd | Checks the state of DRBD devices | srcpackage
    | nagios-plugins-extras | Nagios Plug-Ins which depend on ad-> | package
    | nagios-plugins-gwfl | SNMP checks to monitor a lot of HP-> | package
    | nagios-plugins-gwfl | SNMP checks to monitor a lot of HP-> | srcpackage
    | nagios-plugins-gwfl-debuginfo | Debug information for package nagi-> | package
    | nagios-plugins-gwfl-debugsource | Debug sources for package nagios-p-> | package
    | nagios-plugins-hpasm | Checks hardware health of Hewlett–> | package
    | nagios-plugins-hpasm | Checks hardware health of Hewlett–> | srcpackage
    | nagios-plugins-maintenance | Check, if a host is in service | package
    | nagios-plugins-maintenance | Check, if a host is in service | srcpackage
    | nagios-plugins-megaraid_sas | Check drives attached to LSI megar-> | package
    | nagios-plugins-megaraid_sas | Check drives attached to LSI megar-> | srcpackage
    | nagios-plugins-mem | Check memory plugin for Nagios | package
    | nagios-plugins-mem | Check memory plugin for Nagios | srcpackage
    | nagios-plugins-nfsmounts | Checks all local NFS mounts | package
    | nagios-plugins-nfsmounts | Checks all local NFS mounts | srcpackage
    | nagios-plugins-nis | Nagios plugin to check the status -> | package
    | nagios-plugins-nis | Nagios plugin to check the status -> | srcpackage
    | nagios-plugins-nrpe | Nagios NRPE plugin | package
    | nagios-plugins-openvpn | Verify the state of the clients co-> | package
    | nagios-plugins-openvpn | Verify the state of the clients co-> | srcpackage
    | nagios-plugins-postgres | Postgres monitoring script using c-> | package
    | nagios-plugins-printer | Generic check for printers support-> | package
    | nagios-plugins-printer | Generic check for printers support-> | srcpackage
    | nagios-plugins-ps | Nagios plugin to check a specific -> | package
    | nagios-plugins-ps | Nagios plugin to check a specific -> | srcpackage
    | nagios-plugins-rsync | Nagios plugin for checking rsync s-> | package
    | nagios-plugins-rsync | Nagios plugin for checking rsync s-> | srcpackage
    | nagios-plugins-sign | Nagios plugin to check the status -> | package
    | nagios-plugins-sign | Nagios plugin to check the status -> | srcpackage
    | nagios-plugins-sip | Test a SIP server/device for avail-> | package
    | nagios-plugins-sip | Test a SIP server/device for avail-> | srcpackage
    | nagios-plugins-snmp | SNMP Plugins for Nagios v3.x in Perl | package
    | nagios-plugins-snmp | SNMP Plugins for Nagios v3.x in Perl | srcpackage
    | nagios-plugins-source-service | Nagios plugin for checking the Bui-> | package
    | nagios-plugins-source-service | Nagios plugin for checking the Bui-> | srcpackage
    | nagios-plugins-tftp | Nagios plugin to check a tftp server | package
    | nagios-plugins-tftp | Nagios plugin to check a tftp server | srcpackage
    | nagios-plugins-tw_cli | Reporting the RAID status of 3ware-> | package
    | nagios-plugins-tw_cli | Reporting the RAID status of 3ware-> | srcpackage
    | nagios-plugins-zypper | Nagios plugin for checking softwar-> | package
    | nagios-plugins-zypper | Nagios plugin for checking softwar-> | srcpackage
    | nagios-theme-nuvola | Nuvola theme for Nagios webfrontend | package
    | nagios-theme-nuvola | Nuvola theme for Nagios webfrontend | srcpackage
    | nagios-theme-switcher | Simple Theme Switcher for Nagios W-> | package
    | nagios-theme-switcher | Simple Theme Switcher for Nagios W-> | srcpackage
    | nagios-www | Provides the HTML and CGI files fo-> | package
    | pnp4nagios | Tool for producing graphs from Nag-> | package
    | pnp4nagios | Tool for producing graphs from Nag-> | srcpackage

    Viu como tem muito mais opções agora? Veja a versão do Nagios que já está pronta para ser instalado.

    # zypper info nagios

    Resultado do comando:

    Loading repository data…
    Reading installed packages…
    Information for package nagios:
    Repository: monitoring
    Name: nagios
    Version: 3.2.3-26.1
    Arch: i586
    Vendor: openSUSE Build Service
    Support Level: unknown
    Installed: No
    Status: not installed
    Installed Size: 4.2 MiB
    Summary: The Nagios Network Monitor
    Description:
    Nagios is a program that will monitor hosts and services on your network. It has the ability to email or page you when a problem arises and when a problem is resolved. Nagios is written in C and is designed to run under Linux (and some other *NIX variants) as a background process, intermittently running checks on various services that you specify.
    The actual service checks are performed by separate “plugin” programs which return the status of the checks to Nagios. The plugins are available at http://sourceforge.net/projects/nagiosplug This package provide core programs for nagios. The web interface, documentation, and development files are built as separate packages.

    Bora instalar ?

    Digite os comandos em negrito abaixo ,

    # zypper in nagios

    Resultado do comando:

    Loading repository data…
    Reading installed packages…
    Resolving package dependencies…
    The following NEW packages are going to be installed:
    apache2 apache2-mod_php5 apache2-prefork apache2-utils gd libapr1 libapr-util1
    libmm14 nagios nagios-plugins nagios-www perl-Crypt-DES perl-Net-SNMP php5
    php5-ctype php5-dom php5-hash php5-iconv php5-json php5-tokenizer php5-xmlreader
    php5-xmlwriter
    The following recommended packages were automatically selected:
    nagios-plugins nagios-www php5-ctype php5-dom php5-hash php5-iconv php5-json
    php5-tokenizer php5-xmlreader php5-xmlwriter
    The following packages are not supported by their vendor:
    nagios nagios-plugins nagios-www perl-Net-SNMP
    22 new packages to install.
    Overall download size: 7.1 MiB. After the operation, additional 24.3 MiB will be used.

    – digite yes para aceitar a instalação
    Continue? [y/n/?] (y): y

    Resultado do comando:

    Retrieving package perl-Crypt-DES-2.05-1.22.i586 (1/22), 19.0 KiB (34.0 KiB unpacked)
    Installing: perl-Crypt-DES-2.05-1.22 [done]
    Retrieving package libmm14-1.4.2-16.22.i586 (2/22), 40.0 KiB (40.0 KiB unpacked)
    Installing: libmm14-1.4.2-16.22 [done]
    Retrieving package libapr1-1.3.3-11.16.1.i586 (3/22), 127.0 KiB (291.0 KiB unpacked)
    Installing: libapr1-1.3.3-11.16.1 [done]
    Retrieving package gd-2.0.36.RC1-52.18.i586 (4/22), 151.0 KiB (610.0 KiB unpacked)
    Installing: gd-2.0.36.RC1-52.18 [done]
    Retrieving package nagios-3.2.3-26.1.i586 (5/22), 302.0 KiB (4.2 MiB unpacked)
    Retrieving: nagios-3.2.3-26.1.i586.rpm [done (38.8 KiB/s)]
    Installing: nagios-3.2.3-26.1 [done]
    Additional rpm output:
    Updating etc/sysconfig/nagios…
    Retrieving package php5-5.2.6-50.24.1.i586 (6/22), 970.0 KiB (2.8 MiB unpacked)
    Installing: php5-5.2.6-50.24.1 [done]
    Retrieving package libapr-util1-1.3.4-12.20.2.i586 (7/22), 94.0 KiB (201.0 KiB unpacked)
    Installing: libapr-util1-1.3.4-12.20.2 [done]
    Retrieving package perl-Net-SNMP-5.2.0-138.1.i586 (8/22), 96.0 KiB (389.0 KiB unpacked)
    Retrieving: perl-Net-SNMP-5.2.0-138.1.i586.rpm [done (29.9 KiB/s)]
    Installing: perl-Net-SNMP-5.2.0-138.1 [done]
    Retrieving package php5-xmlwriter-5.2.6-50.24.1.i586 (9/22), 38.0 KiB (28.0 KiB unpacked)
    Installing: php5-xmlwriter-5.2.6-50.24.1 [done]
    Retrieving package php5-tokenizer-5.2.6-50.24.1.i586 (10/22), 36.0 KiB (18.0 KiB unpacked)
    Installing: php5-tokenizer-5.2.6-50.24.1 [done]
    Retrieving package php5-json-5.2.6-50.24.1.i586 (11/22), 41.0 KiB (30.0 KiB unpacked)
    Installing: php5-json-5.2.6-50.24.1 [done]
    Retrieving package php5-iconv-5.2.6-50.24.1.i586 (12/22), 44.0 KiB (36.0 KiB unpacked)
    Installing: php5-iconv-5.2.6-50.24.1 [done]
    Retrieving package php5-hash-5.2.6-50.24.1.i586 (13/22), 102.0 KiB (183.0 KiB unpacked)
    Installing: php5-hash-5.2.6-50.24.1 [done]
    Retrieving package php5-dom-5.2.6-50.24.1.i586 (14/22), 77.0 KiB (162.0 KiB unpacked)
    Installing: php5-dom-5.2.6-50.24.1 [done]
    Retrieving package php5-ctype-5.2.6-50.24.1.i586 (15/22), 34.0 KiB (15.0 KiB unpacked)
    Installing: php5-ctype-5.2.6-50.24.1 [done]
    Retrieving package apache2-utils-2.2.10-2.24.5.i586 (16/22), 110.0 KiB (176.0 KiB unpacked)
    Installing: apache2-utils-2.2.10-2.24.5 [done]
    Retrieving package apache2-prefork-2.2.10-2.24.5.i586 (17/22), 265.0 KiB (593.0 KiB unpacked)
    Installing: apache2-prefork-2.2.10-2.24.5 [done]
    Retrieving package nagios-plugins-1.4.15-21.2.i586 (18/22), 663.0 KiB (3.7 MiB unpacked)
    Retrieving: nagios-plugins-1.4.15-21.2.i586.rpm [done (64.3 KiB/s)]
    Installing: nagios-plugins-1.4.15-21.2 [done]
    Additional rpm output:
    Starting SuSEconfig, the SuSE Configuration Tool…
    Running module permissions only
    Reading /etc/sysconfig and updating the system…
    Executing /sbin/conf.d/SuSEconfig.permissions…
    Finished.
    Retrieving package php5-xmlreader-5.2.6-50.24.1.i586 (19/22), 40.0 KiB (28.0 KiB unpacked)
    Installing: php5-xmlreader-5.2.6-50.24.1 [done]
    Retrieving package apache2-2.2.10-2.24.5.i586 (20/22), 746.0 KiB (2.1 MiB unpacked)
    Installing: apache2-2.2.10-2.24.5 [done]
    Additional rpm output:
    Starting SuSEconfig, the SuSE Configuration Tool…
    Running module permissions only
    Reading /etc/sysconfig and updating the system…
    Executing /sbin/conf.d/SuSEconfig.permissions…
    Finished.
    Updating etc/sysconfig/apache2…
    looking for old 2.0 modules to be renamed…
    Done.
    Retrieving package apache2-mod_php5-5.2.6-50.24.1.i586 (21/22), 869.0 KiB (2.6 MiB unpacked)
    Installing: apache2-mod_php5-5.2.6-50.24.1 [done]
    Retrieving package nagios-www-3.2.3-26.1.i586 (22/22), 2.4 MiB (6.1 MiB unpacked)
    Retrieving: nagios-www-3.2.3-26.1.i586.rpm [done (154.0 KiB/s)]
    Installing: nagios-www-3.2.3-26.1 [done]

    # nagios

    Pronto amigo, seu Nagios Core está instalado, veja com o comando.

    # rpm -qa | grep nagios

    Resultado do comando:

    nagios-3.2.3-26.1
    nagios-plugins-1.4.15-21.2
    nagios-www-3.2.3-26.1

    Percebeu que ele já instala todos os pacotes (Apache, PHP, GCC), já cria os usuários, grupos, dá os devidos direitos em pastas, nós só precisamos cadastrar um usuário agora.

    # htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin

    Habilite uma senha ao seu usuário, é com ele que vamos acessar a tela gŕafica no Nagios via browser.

    Para ficar bom, e acabar a instalação, vamos configurar o Nagios Core e o Apache para iniciar sozinhos.

    # chkconfig -add nagios

    Resultado do comando:

    nagios 0:off 1:off 2:off 3:on 4:off 5:on 6:off

    # chkconfig nagios  on # chkconfig -add apache2

    Resultado do comando:

    apache2 0:off 1:off 2:off 3:on 4:off 5:on 6:off

    # chkconfig apache2  on

    Pronto, se quizer fazer um teste, dê um boot no servidor.

    # reboot

    Agora via browser, acesse seu servidor

    http://ip_do_servidor/nagios

    Faça o login com o usuário nagiosadmin e a senha que você cadastrou.

    Depois vamos desenvolver um tutorial para cadastros de dispositivos e serviços.

    Abraços e espero que contribuído com alguma coisa.

    Entre em contato conosco .

    (61) 3551-1921 – (61) 984 – 681 -921

Leave a Reply

Your email address will not be published. Required fields are marked *