SlideShare uma empresa Scribd logo
Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran...


                SNMP é usado como parte de monitoramento de utilização de recursos em dispositivos ligados na rede, informa utilização de CPU, tráfego de rede,
                status de serviços e etc.

         Estou escrevendo esse artigo por que será pré-requisito na configuração e instalação do Cacti para “grafar” os recursos dos dispositivos monitorados.

         Pré-requisitos
               Instalação mínima do CentOS e RedHat 5.3

         Instalação do serviço SNMPd

         A instalação será feita via Yum

          yum install net‐snmp.i386 net‐snmp‐libs.i386 net‐snmp‐utils.i386

          ...
          Installed: net‐snmp.i386 1:5.3.2.2‐5.el5_3.2 net‐snmp‐libs.i386 1:5.3.2.2‐5.el5_3.2 net‐snmp‐utils.i386
          1:5.3.2.2‐5.el5_3.2
          Dependency Installed: lm_sensors.i386 0:2.10.7‐4.el5
          Complete!

         É interessante garantir que o serviço será iniciado no boot

          chkconfig ‐‐levels 35 snmpd on

         Configurando o serviço SNMP

         Depois de instalado, o SNMP precisa ser configurado para responder a uma comunidade e em que modo ele irá responder.

         Também é interessante colocar uma descrição de quem é o responsável pelo servidor e onde está localizado o equipamento.

         Para iniciar a configuração, vá ao diretório /etc/snmp e apague o arquivo original que está lá ou renomeie, caso queira futuramente consultá-lo.

              1 cd /etc/snmp
              2 mv snmpd.conf snmpd.conf.orig

         Inicie o processo de configuração com o comando snmpconf, faz parte do pacote net-snmp-utils e é uma mão na roda, diga-se de passagem

              1 cd /etc/snmp
              2 snmpconf

         Uma série de questionários será apresentada.

         Na primeira fase

          I can create the following types of configuration files for you.
          Select the file type you wish to create:
          (you can create more than one as you run this program)

              1:    snmpd.conf
              2:    snmp.conf
              3:    snmptrapd.conf

          Other options: quit

          Select File: 1

         Selecione 1 para gerar o arquivo snmpd.conf que é o responsável por colher as métricas de utilização de recursos do SO.

         Aqui nessa sessão da configuração tem uma pegadinha: nem sempre a ordem apresentada é a mesma, então, preste atenção na opção escolhida.

          The configuration information which can be put into snmpd.conf is divided
          into sections. Select a configuration section for snmpd.conf
          that you wish to create:

              1:    Monitor Various Aspects of the Running Host
              2:    Access Control Setup
              3:    Extending the Agent
              4:    Trap Destinations
              5:    System Information Setup
              6:    Agent Operating Mode

          Other options: finished

          Select section: 2

         A primeira configuração é informações de acesso, então é a opção 2 “Access Control Setup”

          Section: Access Control Setup
          Description:
            This section defines who is allowed to talk to your running
            snmp agent.

          Select from:

              1:    a SNMPv3 read‐write user


1 de 4                                                                                                                                                           11/8/2011 13:42
Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran...


              1:   a   SNMPv3 read‐write user
              2:   a   SNMPv3 read‐only user
              3:   a   SNMPv1/SNMPv2c read‐only access community name
              4:   a   SNMPv1/SNMPv2c read‐write access community name

          Other options: finished, list

          Select section: 3

         Permitir acesso somente leitura aos dados do servidor. Evita algumas surpresas :)

         Opção escolhida: 3 “SNMPv1/SNMPv2c read-only access community name”

          Configuring: rocommunity
          Description:
            a SNMPv1/SNMPv2c read‐only access community name
              arguments: community [default|hostname|network/bits] [oid]

          The community name to add read‐only access for: 5nMPC0mmunity

         Nome da comunidade, não coloque “public” por que é muito manjada, e qualquer network scanner vai testar por isso, escolha uma mais difícil, colocando
         números e letras maiúsculas e minúsculas, evite colocar símbolos como $, #, % etc, vai confundir e gerar problemas futuros para scripts e para o próprio
         Cacti. Se utilizar o Nagios então, tá perdido ;)

         O nome escolhido aqui foi 5nMPC0mmunity

          The hostname or network address to accept this community name from [RETURN for all]:

         Quem vai ter acesso ao serviço SNMP, se pressionar direto vai liberar pra todos que souberem o nome da comunidade, caso queira restringir a um host apenas,
         coloque o IP do host, se é para um rede, coloque a rede aqui no formato 192.168.0.0/24

          The OID that this community should be restricted to [RETURN for no‐restriction]:

         Se quer permitir a visualização de apenas alguns recursos, coloque o OID do recurso aqui, no caso, vou deixar liberado para todos os recursos serem
         visualizados

         Finalizada a configuração de controle de acesso, vai voltar para a sessão própria. Como está terminado escreva finished ou apenas f para sair e voltar ao
         menu principal.

          Section: Access Control Setup
          Description:
            This section defines who is allowed to talk to your running
            snmp agent.

          Select from:

              1:   a   SNMPv3 read‐write user
              2:   a   SNMPv3 read‐only user
              3:   a   SNMPv1/SNMPv2c read‐only access community name
              4:   a   SNMPv1/SNMPv2c read‐write access community name

          Other options: finished, list

          Select section: finished

         Próxima fase, informar detalhes do dispositivo, como contato e localização física.

          The configuration information which can be put into snmpd.conf is divided
          into sections. Select a configuration section for snmpd.conf
          that you wish to create:

              1:   Monitor Various Aspects of the Running Host
              2:   Access Control Setup
              3:   Extending the Agent
              4:   Trap Destinations
              5:   System Information Setup
              6:   Agent Operating Mode

          Other options: finished

          Select section: 5

         Escolha a opção 5 “System Information Setup” e pressione

          Section: System Information Setup
          Description:
            This section defines some of the information reported in
            the "system" mib group in the mibII tree.

          Select from:

              1:   The [typically physical] location of the system.
              2:   The contact information for the administrator
              3:   The proper value for the sysServices object.

          Other options: finished, list



2 de 4                                                                                                                                                         11/8/2011 13:42
Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran...



          Select section: 1

         Opção escolhida 1, para informações de localização do equipamento

          Configuring: syslocation
          Description:
            The [typically physical] location of the system.
              Note that setting this value here means that when trying to
              perform an snmp SET operation to the sysLocation.0 variable will make
              the agent return the "notWritable" error code. IE, including
              this token in the snmpd.conf file will disable write access to
              the variable.
              arguments: location_string

          The location of the system: Data Center, Rack 3

         Informado onde está o equipamento Data Center, Rack 3, pressione quando terminar.

         Voltando para a tela de configuração com informações do equipamento, selecione a opção 2 para dizer quem é o responsável

          Section: System Information Setup
          Description:
            This section defines some of the information reported in
            the "system" mib group in the mibII tree.

          Select from:

              1:   The [typically physical] location of the system.
              2:   The contact information for the administrator
              3:   The proper value for the sysServices object.

          Other options: finished, list

          Select section: 2

          Configuring: syscontact
          Description:
            The contact information for the administrator
              Note that setting this value here means that when trying to
              perform an snmp SET operation to the sysContact.0 variable will make
              the agent return the "notWritable" error code. IE, including
              this token in the snmpd.conf file will disable write access to
              the variable.
              arguments: contact_string

          The contact information: Daniel Kühl Lima

         Informe alguns dados que facilitem a localização do responsável. Aqui foi informado Daniel Kühl Lima. Pressione quando terminar e voltará para a tela de
         configuração de informações.

          Section: System Information Setup
          Description:
            This section defines some of the information reported in
            the "system" mib group in the mibII tree.

          Select from:

              1:   The [typically physical] location of the system.
              2:   The contact information for the administrator
              3:   The proper value for the sysServices object.

          Other options: finished, list

          Select section: finished

         Sessão terminada, dá pra sair dessa tela e voltar ao menu principal. Escreve finished ou f para sair.

         Voltando para o menu principal, e como está tudo configurado como desejamos, escreva finished ou f para salvar e terminar a tarefa.

          The configuration information which can be put into snmpd.conf is divided
          into sections. Select a configuration section for snmpd.conf
          that you wish to create:

              1:   Monitor Various Aspects of the Running Host
              2:   Access Control Setup
              3:   Extending the Agent
              4:   Trap Destinations
              5:   System Information Setup
              6:   Agent Operating Mode

          Other options: finished

          Select section: finished

          I can create the following types of configuration files for you.
          Select the file type you wish to create:


3 de 4                                                                                                                                                     11/8/2011 13:42
Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran...


          Select the file type you wish to create:
          (you can create more than one as you run this program)

               1:   snmpd.conf
               2:   snmp.conf
               3:   snmptrapd.conf

          Other options: quit

          Select File: quit

         Escreva quit para sair de vez.

         Iniciando o serviço SNMP

         Com o serviço configurado é hora de iniciar.

               1 service snmpd start

               1 Starting snmpd:                                                                 [   OK    ]

         Verificando o funcionamento

         Pra verificar se está tudo a contento, execute o comando a seguir que irá se conectar ao serviço SNMP e retornará as métricas do sistema.

               1 snmpwalk ‐c 5nMPC0mmunity ‐v2c localhost
         SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.30.5-fogonacaixadagua #7 SMP Fri Sep 11 11:32:29 BRT 2009 i686
         SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
         DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (13823) 0:02:18.23
         SNMPv2-MIB::sysContact.0 = STRING: "Daniel Kühl Lima"
         SNMPv2-MIB::sysName.0 = STRING: localhost.localdomain
         SNMPv2-MIB::sysLocation.0 = STRING: "Data Center, Rack 3"
         SNMPv2-MIB::sysORLastChange.0 = Timeticks: (9) 0:00:00.09

         ...

         No final do processo o arquivo /etc/snmp/snmpd.conf ficou assim:
         ###########################################################################
         #
         # snmpd.conf
         #
         #   - created by the snmpconf configuration program
         #

         ###########################################################################
         # SECTION: Access Control Setup
         #
         #   This section defines who is allowed to talk to your running
         #   snmp agent.

         # rocommunity: a SNMPv1/SNMPv2c read-only access community name
         #   arguments: community [default|hostname|network/bits] [oid]

         rocommunity     5nMPC0mmunity

         ###########################################################################
         # SECTION: System Information Setup
         #
         #   This section defines some of the information reported in
         #   the "system" mib group in the mibII tree.

         # syslocation: The [typically physical] location of the system.
         #   Note that setting this value here means that when trying to
         #   perform an snmp SET operation to the sysLocation.0 variable will make
         #   the agent return the "notWritable" error code. IE, including
         #   this token in the snmpd.conf file will disable write access to
         #   the variable.
         #   arguments: location_string

         syslocation     "Data Center, Rack 3"

         # syscontact: The contact information for the administrator
         #   Note that setting this value here means that when trying to
         #   perform an snmp SET operation to the sysContact.0 variable will make
         #   the agent return the "notWritable" error code. IE, including
         #   this token in the snmpd.conf file will disable write access to
         #   the variable.
         #   arguments: contact_string

         syscontact    "Daniel Kühl Lima"

         Pronto.




4 de 4                                                                                                                                               11/8/2011 13:42

Mais conteúdo relacionado

PPTX
Escalonamento no Windows
PDF
1os passoscisco
PPT
Gerenciamento de Servidores Linux utilizando SNMP
ODP
Gerência de Redes - 2.Modelo SNMP
PPT
Personalizacao Do Sistema E Servicos
PPT
PDF
Seguranca da Informação - Filtros/tcpd
PPTX
Integrando o InduSoft Web Studio com Equipamentos Beckhoff
Escalonamento no Windows
1os passoscisco
Gerenciamento de Servidores Linux utilizando SNMP
Gerência de Redes - 2.Modelo SNMP
Personalizacao Do Sistema E Servicos
Seguranca da Informação - Filtros/tcpd
Integrando o InduSoft Web Studio com Equipamentos Beckhoff

Mais procurados (20)

PPTX
Driver Configuration Webinar
PDF
3929 linux passo a passo 1
PDF
Administração de Redes Linux - II
PDF
Apresentacao Aula03 So
PDF
Arquitetura de Computadores: Processos e Threads
PDF
Processos e threads cap 02 (i unidade)
PPTX
Processos threads senai
PDF
Dhcp com controle_ip_compartilhamento
PDF
Redes prática - Inetd
PDF
PDF
Servidor de internet (NAT, Squid, Sarg)
PPTX
Processos e threads
PDF
Sistemas operacionais 14
PPT
Visão Geral: Introdução
PDF
Ferramentas para Detecção de Problemas em Redes
PDF
Systemd: A nova fronteira - João Avelino Bellomo Filho
PPT
Apostila 5 processos e threads
PPTX
Princípios básicos da análise de malware
PPT
Gerências de Processos: Sincronização
Driver Configuration Webinar
3929 linux passo a passo 1
Administração de Redes Linux - II
Apresentacao Aula03 So
Arquitetura de Computadores: Processos e Threads
Processos e threads cap 02 (i unidade)
Processos threads senai
Dhcp com controle_ip_compartilhamento
Redes prática - Inetd
Servidor de internet (NAT, Squid, Sarg)
Processos e threads
Sistemas operacionais 14
Visão Geral: Introdução
Ferramentas para Detecção de Problemas em Redes
Systemd: A nova fronteira - João Avelino Bellomo Filho
Apostila 5 processos e threads
Princípios básicos da análise de malware
Gerências de Processos: Sincronização
Anúncio

Destaque (8)

PDF
Otimizando seu Squid
PDF
Samsung r440 com wireless broadcom bcm4313 no ubuntu 11.10
PDF
Instalando rrd tool-no-centos-5-usando-yum
PDF
Compartilhamento no samba com permissão de grupo
PDF
Canivete shell
PDF
Iptables bridging and firewalling
PDF
Instalação geo ip
PDF
Instalando Cacti no CentOS 5
Otimizando seu Squid
Samsung r440 com wireless broadcom bcm4313 no ubuntu 11.10
Instalando rrd tool-no-centos-5-usando-yum
Compartilhamento no samba com permissão de grupo
Canivete shell
Iptables bridging and firewalling
Instalação geo ip
Instalando Cacti no CentOS 5
Anúncio

Semelhante a Instalando e configurando o serviço snmpd no red hat 5.3 cent_os (20)

PPTX
Zabbix e SNMP - Zabbix Conference LatAm - André Déo
PPTX
Zabbix e SNMP - Zabbix Conference LatAM 2016
PDF
Zabbix Conference LatAm 2016 - Andre Deo - SNMP and Zabbix
PDF
Zabbix + SNMP: Compartilhando experiências sobre SNMP
DOC
Trab linux+sarg
PDF
MRTG - SNMP na Prática
PDF
Introdução ao SNMP
PDF
SNMP - Rafael Rodriques
PDF
Supervisão e Monitorização
PDF
Foca avancado
PDF
Guia Foca - Linux - Avançado
PDF
Foca linux3
PDF
Microsoft word linux-03-03-prefis moveis
PDF
Livro pfsense 2.0 pt br
PDF
Livro pfsense 2.0 pt br
PDF
Livro do pfsense 2.0
PDF
PFSense - Configuração e Instalação PT-BR
PDF
PDF
Linux - Samba
PDF
Comando para rede
Zabbix e SNMP - Zabbix Conference LatAm - André Déo
Zabbix e SNMP - Zabbix Conference LatAM 2016
Zabbix Conference LatAm 2016 - Andre Deo - SNMP and Zabbix
Zabbix + SNMP: Compartilhando experiências sobre SNMP
Trab linux+sarg
MRTG - SNMP na Prática
Introdução ao SNMP
SNMP - Rafael Rodriques
Supervisão e Monitorização
Foca avancado
Guia Foca - Linux - Avançado
Foca linux3
Microsoft word linux-03-03-prefis moveis
Livro pfsense 2.0 pt br
Livro pfsense 2.0 pt br
Livro do pfsense 2.0
PFSense - Configuração e Instalação PT-BR
Linux - Samba
Comando para rede

Mais de Carlos Eduardo (20)

PDF
Criando plugin para o Nagios em Shell Script _ Nagios
PDF
Alterar nome do_domínio–rendom_win-2008_e_2003
PDF
Configuração dns memorial descritivo
PDF
Additional resources repositories_rpm_forge - centos wiki
PDF
Postfix amavisd connect to 127.0.0.1[127.0.0.1]-10024_ connection refused _...
PDF
Migrate linux user password to postfix vmail database
PDF
Poppassd setup howto for rhel cent os 5 ‹‹ linux mail server setup and howto ...
PDF
Exploit access root to kernel 2.6.32 2.6.36 privilege escalation exploit
PDF
How to root phones or tablets running android 2.3 gingerbread jailbreak an...
PDF
Converting parallels or vm ware to virtual box
PDF
Startup guide for kvm on cent os 6
PDF
Alterar memória kvm virtual machine
PDF
Comando kvm terminal
PDF
Como criar um repositório Ubuntu
PDF
Backup Incremental auto - Windows Server 2008
PDF
SSL no apache
PDF
Alterar password linux user pam autentication
PDF
Postfix, Imap e Pop3
PDF
Linux instalação e-conf postfix - pop3 eimap
Criando plugin para o Nagios em Shell Script _ Nagios
Alterar nome do_domínio–rendom_win-2008_e_2003
Configuração dns memorial descritivo
Additional resources repositories_rpm_forge - centos wiki
Postfix amavisd connect to 127.0.0.1[127.0.0.1]-10024_ connection refused _...
Migrate linux user password to postfix vmail database
Poppassd setup howto for rhel cent os 5 ‹‹ linux mail server setup and howto ...
Exploit access root to kernel 2.6.32 2.6.36 privilege escalation exploit
How to root phones or tablets running android 2.3 gingerbread jailbreak an...
Converting parallels or vm ware to virtual box
Startup guide for kvm on cent os 6
Alterar memória kvm virtual machine
Comando kvm terminal
Como criar um repositório Ubuntu
Backup Incremental auto - Windows Server 2008
SSL no apache
Alterar password linux user pam autentication
Postfix, Imap e Pop3
Linux instalação e-conf postfix - pop3 eimap

Último (11)

PDF
eBook - GUIA DE CONSULTA RAPIDA EM ROTEADORES E SWITCHES CISCO - VOL I.pdf
PDF
Manejo integrado de pragas na cultura do algodão
PPTX
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
PPTX
Utilizando code blockes por andre backes
PDF
Termos utilizados na designação de relação entre pessoa e uma obra.pdf
PPT
Conceitos básicos de Redes Neurais Artificiais
PPTX
Eng. Software - pontos essenciais para o início
PDF
Jira Software projetos completos com scrum
PPTX
Viasol Energia Solar -Soluções para geração e economia de energia
PPTX
Tipos de servidor em redes de computador.pptx
PPTX
Proposta de Implementação de uma Rede de Computador Cabeada.pptx
eBook - GUIA DE CONSULTA RAPIDA EM ROTEADORES E SWITCHES CISCO - VOL I.pdf
Manejo integrado de pragas na cultura do algodão
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
Utilizando code blockes por andre backes
Termos utilizados na designação de relação entre pessoa e uma obra.pdf
Conceitos básicos de Redes Neurais Artificiais
Eng. Software - pontos essenciais para o início
Jira Software projetos completos com scrum
Viasol Energia Solar -Soluções para geração e economia de energia
Tipos de servidor em redes de computador.pptx
Proposta de Implementação de uma Rede de Computador Cabeada.pptx

Instalando e configurando o serviço snmpd no red hat 5.3 cent_os

  • 1. Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran... SNMP é usado como parte de monitoramento de utilização de recursos em dispositivos ligados na rede, informa utilização de CPU, tráfego de rede, status de serviços e etc. Estou escrevendo esse artigo por que será pré-requisito na configuração e instalação do Cacti para “grafar” os recursos dos dispositivos monitorados. Pré-requisitos Instalação mínima do CentOS e RedHat 5.3 Instalação do serviço SNMPd A instalação será feita via Yum yum install net‐snmp.i386 net‐snmp‐libs.i386 net‐snmp‐utils.i386 ... Installed: net‐snmp.i386 1:5.3.2.2‐5.el5_3.2 net‐snmp‐libs.i386 1:5.3.2.2‐5.el5_3.2 net‐snmp‐utils.i386 1:5.3.2.2‐5.el5_3.2 Dependency Installed: lm_sensors.i386 0:2.10.7‐4.el5 Complete! É interessante garantir que o serviço será iniciado no boot chkconfig ‐‐levels 35 snmpd on Configurando o serviço SNMP Depois de instalado, o SNMP precisa ser configurado para responder a uma comunidade e em que modo ele irá responder. Também é interessante colocar uma descrição de quem é o responsável pelo servidor e onde está localizado o equipamento. Para iniciar a configuração, vá ao diretório /etc/snmp e apague o arquivo original que está lá ou renomeie, caso queira futuramente consultá-lo. 1 cd /etc/snmp 2 mv snmpd.conf snmpd.conf.orig Inicie o processo de configuração com o comando snmpconf, faz parte do pacote net-snmp-utils e é uma mão na roda, diga-se de passagem 1 cd /etc/snmp 2 snmpconf Uma série de questionários será apresentada. Na primeira fase I can create the following types of configuration files for you. Select the file type you wish to create: (you can create more than one as you run this program) 1: snmpd.conf 2: snmp.conf 3: snmptrapd.conf Other options: quit Select File: 1 Selecione 1 para gerar o arquivo snmpd.conf que é o responsável por colher as métricas de utilização de recursos do SO. Aqui nessa sessão da configuração tem uma pegadinha: nem sempre a ordem apresentada é a mesma, então, preste atenção na opção escolhida. The configuration information which can be put into snmpd.conf is divided into sections. Select a configuration section for snmpd.conf that you wish to create: 1: Monitor Various Aspects of the Running Host 2: Access Control Setup 3: Extending the Agent 4: Trap Destinations 5: System Information Setup 6: Agent Operating Mode Other options: finished Select section: 2 A primeira configuração é informações de acesso, então é a opção 2 “Access Control Setup” Section: Access Control Setup Description: This section defines who is allowed to talk to your running snmp agent. Select from: 1: a SNMPv3 read‐write user 1 de 4 11/8/2011 13:42
  • 2. Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran... 1: a SNMPv3 read‐write user 2: a SNMPv3 read‐only user 3: a SNMPv1/SNMPv2c read‐only access community name 4: a SNMPv1/SNMPv2c read‐write access community name Other options: finished, list Select section: 3 Permitir acesso somente leitura aos dados do servidor. Evita algumas surpresas :) Opção escolhida: 3 “SNMPv1/SNMPv2c read-only access community name” Configuring: rocommunity Description: a SNMPv1/SNMPv2c read‐only access community name arguments: community [default|hostname|network/bits] [oid] The community name to add read‐only access for: 5nMPC0mmunity Nome da comunidade, não coloque “public” por que é muito manjada, e qualquer network scanner vai testar por isso, escolha uma mais difícil, colocando números e letras maiúsculas e minúsculas, evite colocar símbolos como $, #, % etc, vai confundir e gerar problemas futuros para scripts e para o próprio Cacti. Se utilizar o Nagios então, tá perdido ;) O nome escolhido aqui foi 5nMPC0mmunity The hostname or network address to accept this community name from [RETURN for all]: Quem vai ter acesso ao serviço SNMP, se pressionar direto vai liberar pra todos que souberem o nome da comunidade, caso queira restringir a um host apenas, coloque o IP do host, se é para um rede, coloque a rede aqui no formato 192.168.0.0/24 The OID that this community should be restricted to [RETURN for no‐restriction]: Se quer permitir a visualização de apenas alguns recursos, coloque o OID do recurso aqui, no caso, vou deixar liberado para todos os recursos serem visualizados Finalizada a configuração de controle de acesso, vai voltar para a sessão própria. Como está terminado escreva finished ou apenas f para sair e voltar ao menu principal. Section: Access Control Setup Description: This section defines who is allowed to talk to your running snmp agent. Select from: 1: a SNMPv3 read‐write user 2: a SNMPv3 read‐only user 3: a SNMPv1/SNMPv2c read‐only access community name 4: a SNMPv1/SNMPv2c read‐write access community name Other options: finished, list Select section: finished Próxima fase, informar detalhes do dispositivo, como contato e localização física. The configuration information which can be put into snmpd.conf is divided into sections. Select a configuration section for snmpd.conf that you wish to create: 1: Monitor Various Aspects of the Running Host 2: Access Control Setup 3: Extending the Agent 4: Trap Destinations 5: System Information Setup 6: Agent Operating Mode Other options: finished Select section: 5 Escolha a opção 5 “System Information Setup” e pressione Section: System Information Setup Description: This section defines some of the information reported in the "system" mib group in the mibII tree. Select from: 1: The [typically physical] location of the system. 2: The contact information for the administrator 3: The proper value for the sysServices object. Other options: finished, list 2 de 4 11/8/2011 13:42
  • 3. Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran... Select section: 1 Opção escolhida 1, para informações de localização do equipamento Configuring: syslocation Description: The [typically physical] location of the system. Note that setting this value here means that when trying to perform an snmp SET operation to the sysLocation.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: location_string The location of the system: Data Center, Rack 3 Informado onde está o equipamento Data Center, Rack 3, pressione quando terminar. Voltando para a tela de configuração com informações do equipamento, selecione a opção 2 para dizer quem é o responsável Section: System Information Setup Description: This section defines some of the information reported in the "system" mib group in the mibII tree. Select from: 1: The [typically physical] location of the system. 2: The contact information for the administrator 3: The proper value for the sysServices object. Other options: finished, list Select section: 2 Configuring: syscontact Description: The contact information for the administrator Note that setting this value here means that when trying to perform an snmp SET operation to the sysContact.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: contact_string The contact information: Daniel Kühl Lima Informe alguns dados que facilitem a localização do responsável. Aqui foi informado Daniel Kühl Lima. Pressione quando terminar e voltará para a tela de configuração de informações. Section: System Information Setup Description: This section defines some of the information reported in the "system" mib group in the mibII tree. Select from: 1: The [typically physical] location of the system. 2: The contact information for the administrator 3: The proper value for the sysServices object. Other options: finished, list Select section: finished Sessão terminada, dá pra sair dessa tela e voltar ao menu principal. Escreve finished ou f para sair. Voltando para o menu principal, e como está tudo configurado como desejamos, escreva finished ou f para salvar e terminar a tarefa. The configuration information which can be put into snmpd.conf is divided into sections. Select a configuration section for snmpd.conf that you wish to create: 1: Monitor Various Aspects of the Running Host 2: Access Control Setup 3: Extending the Agent 4: Trap Destinations 5: System Information Setup 6: Agent Operating Mode Other options: finished Select section: finished I can create the following types of configuration files for you. Select the file type you wish to create: 3 de 4 11/8/2011 13:42
  • 4. Instalando e configurando o serviço SNMPd no Red Hat 5.3 / CentOS 5.3... http://www.fogonacaixadagua.com.br/2009/09/instalando-e-configuran... Select the file type you wish to create: (you can create more than one as you run this program) 1: snmpd.conf 2: snmp.conf 3: snmptrapd.conf Other options: quit Select File: quit Escreva quit para sair de vez. Iniciando o serviço SNMP Com o serviço configurado é hora de iniciar. 1 service snmpd start 1 Starting snmpd: [ OK ] Verificando o funcionamento Pra verificar se está tudo a contento, execute o comando a seguir que irá se conectar ao serviço SNMP e retornará as métricas do sistema. 1 snmpwalk ‐c 5nMPC0mmunity ‐v2c localhost SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.30.5-fogonacaixadagua #7 SMP Fri Sep 11 11:32:29 BRT 2009 i686 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (13823) 0:02:18.23 SNMPv2-MIB::sysContact.0 = STRING: "Daniel Kühl Lima" SNMPv2-MIB::sysName.0 = STRING: localhost.localdomain SNMPv2-MIB::sysLocation.0 = STRING: "Data Center, Rack 3" SNMPv2-MIB::sysORLastChange.0 = Timeticks: (9) 0:00:00.09 ... No final do processo o arquivo /etc/snmp/snmpd.conf ficou assim: ########################################################################### # # snmpd.conf # # - created by the snmpconf configuration program # ########################################################################### # SECTION: Access Control Setup # # This section defines who is allowed to talk to your running # snmp agent. # rocommunity: a SNMPv1/SNMPv2c read-only access community name # arguments: community [default|hostname|network/bits] [oid] rocommunity 5nMPC0mmunity ########################################################################### # SECTION: System Information Setup # # This section defines some of the information reported in # the "system" mib group in the mibII tree. # syslocation: The [typically physical] location of the system. # Note that setting this value here means that when trying to # perform an snmp SET operation to the sysLocation.0 variable will make # the agent return the "notWritable" error code. IE, including # this token in the snmpd.conf file will disable write access to # the variable. # arguments: location_string syslocation "Data Center, Rack 3" # syscontact: The contact information for the administrator # Note that setting this value here means that when trying to # perform an snmp SET operation to the sysContact.0 variable will make # the agent return the "notWritable" error code. IE, including # this token in the snmpd.conf file will disable write access to # the variable. # arguments: contact_string syscontact "Daniel Kühl Lima" Pronto. 4 de 4 11/8/2011 13:42