검색

12.2. snmptrapd구성

download PDF

snmptrapd 데몬에는 snmp-gateway 서비스를 생성할 때 지정해야 하는 auth 설정이 포함되어 있으므로 snmp-gateway (SNMP) 대상을 배포하기 전에 간단한 네트워크 관리 프로토콜(SNMP) 대상을 구성하는 것이 중요합니다.

SNMP 게이트웨이 기능은 Prometheus 스택에서 생성된 경고를 SNMP 관리 플랫폼에 노출하는 수단을 제공합니다. snmptrapd 툴을 기반으로 SNMP 트랩을 대상에 구성할 수 있습니다. 이 도구를 사용하면 하나 이상의 SNMP 트랩 리스너를 설정할 수 있습니다.

다음 매개변수는 구성에 중요합니다.

  • engine-id 는 장치의 고유 식별자이며 SNMPV3 게이트웨이에 필요합니다. Red Hat은 이 매개변수에는 '8000C53F_CLUSTER_FSID_WITHOUT_DASHES_'를 사용하는 것이 좋습니다.
  • snmp-community. SNMP_COMMUNITY_FOR_SNMPV2 매개변수인 snmp-community는 SNMPV2c 게이트웨이의 경우 public 입니다.
  • AUTH_PROTOCOLauth-protocol 은 SNMPV3 게이트웨이의 경우 필수이며 기본적으로 SHA 입니다.
  • PRIVACY_PROTOCOLprivacy-protocol 은 SNMPV3 게이트웨이의 경우 필수입니다.
  • PRIVACY_PASSWORD 는 암호화가 있는 SNMPV3 게이트웨이의 경우 필수입니다.
  • SNMP_V3_AUTH_USER_NAME 은 사용자 이름이며 SNMPV3 게이트웨이의 경우 필수입니다.
  • SNMP_V3_AUTH_PASSWORD 는 암호이며 SNMPV3 게이트웨이의 경우 필수입니다.

사전 요구 사항

  • 실행 중인 Red Hat Ceph Storage 클러스터.
  • 노드에 대한 루트 수준 액세스.
  • Red Hat Enterprise Linux 시스템에 firewalld 를 설치합니다.

프로세스

  1. SNMP 관리 호스트에서 SNMP 패키지를 설치합니다.

    예제

    [root@host01 ~]# dnf install -y net-snmp-utils net-snmp

  2. SNMP의 포트 162를 열어 경고를 수신합니다.

    예제

    [root@host01 ~]# firewall-cmd --zone=public --add-port=162/udp
    [root@host01 ~]# firewall-cmd --zone=public --add-port=162/udp --permanent

  3. SNMP 알림을 이해하고 대상 호스트에서 SNMP 지원을 강화하기 위해 관리 정보 베이스(MIB)를 구현합니다. 기본 리포지토리에서 원시 파일을 복사합니다. https://github.com/ceph/ceph/blob/master/monitoring/snmp/CEPH-MIB.txt

    예제

    [root@host01 ~]# curl -o CEPH_MIB.txt -L https://raw.githubusercontent.com/ceph/ceph/master/monitoring/snmp/CEPH-MIB.txt
    [root@host01 ~]# scp CEPH_MIB.txt root@host02:/usr/share/snmp/mibs

  4. snmptrapd 디렉토리를 생성합니다.

    예제

    [root@host01 ~]# mkdir /root/snmptrapd/

  5. SNMP 버전을 기반으로 각 프로토콜에 대한 snmptrapd 디렉터리에 구성 파일을 생성합니다.

    구문

    format2 %V\n% Agent Address: %A \n Agent Hostname: %B \n Date: %H - %J - %K - %L - %M - %Y \n Enterprise OID: %N \n Trap Type: %W \n Trap Sub-Type: %q \n Community/Infosec Context: %P \n Uptime: %T \n Description: %W \n PDU Attribute/Value Pair Array:\n%v \n -------------- \n
    createuser -e 0x_ENGINE_ID_ SNMPV3_AUTH_USER_NAME AUTH_PROTOCOL SNMP_V3_AUTH_PASSWORD PRIVACY_PROTOCOL PRIVACY_PASSWORD
    authuser log,execute SNMP_V3_AUTH_USER_NAME
    authCommunity   log,execute,net SNMP_COMMUNITY_FOR_SNMPV2

    • SNMPV2c의 경우 다음과 같이 snmptrapd_public.conf 파일을 만듭니다.

      예제

      format2 %V\n% Agent Address: %A \n Agent Hostname: %B \n Date: %H - %J - %K - %L - %M - %Y \n Enterprise OID: %N \n Trap Type: %W \n Trap Sub-Type: %q \n Community/Infosec Context: %P \n Uptime: %T \n Description: %W \n PDU Attribute/Value Pair Array:\n%v \n -------------- \n
      
      authCommunity   log,execute,net public

      여기에 공용 설정은 snmp-gateway 서비스를 배포할 때 사용되는 snmp_community 설정과 일치해야 합니다.

    • 인증이 있는 SNMPV3의 경우 다음과 같이 snmptrapd_auth.conf 파일을 생성합니다.

      예제

      format2 %V\n% Agent Address: %A \n Agent Hostname: %B \n Date: %H - %J - %K - %L - %M - %Y \n Enterprise OID: %N \n Trap Type: %W \n Trap Sub-Type: %q \n Community/Infosec Context: %P \n Uptime: %T \n Description: %W \n PDU Attribute/Value Pair Array:\n%v \n -------------- \n
      createuser -e 0x8000C53Ff64f341c655d11eb8778fa163e914bcc myuser SHA mypassword
      authuser log,execute myuser

      0x8000C53Ff64f341c655d11eb8778fa163e914bcc 문자열은 engine_id 이고 myusermypassword 는 인증 정보입니다. 암호 보안은 SHA 알고리즘에 의해 정의됩니다.

      snmp-gateway 데몬 배포 설정에 해당합니다.

      예제

      snmp_v3_auth_username: myuser
      snmp_v3_auth_password: mypassword

    • SNMPV3 인증 및 암호화의 경우 다음과 같이 snmptrapd_authpriv.conf 파일을 생성합니다.

      예제

      format2 %V\n% Agent Address: %A \n Agent Hostname: %B \n Date: %H - %J - %K - %L - %M - %Y \n Enterprise OID: %N \n Trap Type: %W \n Trap Sub-Type: %q \n Community/Infosec Context: %P \n Uptime: %T \n Description: %W \n PDU Attribute/Value Pair Array:\n%v \n -------------- \n
      createuser -e 0x8000C53Ff64f341c655d11eb8778fa163e914bcc myuser SHA mypassword DES mysecret
      authuser log,execute myuser

      0x8000C53Ff64f341c655d11eb8778fa163e914bcc 문자열은 engine_id 이고 myusermypassword 는 인증 정보입니다. 암호 보안은 SHA 알고리즘에 의해 정의되며 DES 는 개인 정보 암호화 유형입니다.

      snmp-gateway 데몬 배포 설정에 해당합니다.

      예제

      snmp_v3_auth_username: myuser
      snmp_v3_auth_password: mypassword
      snmp_v3_priv_password: mysecret

  6. SNMP 관리 호스트에서 데몬을 실행합니다.

    구문

    /usr/sbin/snmptrapd -M /usr/share/snmp/mibs -m CEPH-MIB.txt -f -C -c /root/snmptrapd/CONFIGURATION_FILE -Of -Lo :162

    예제

    [root@host01 ~]# /usr/sbin/snmptrapd -M /usr/share/snmp/mibs -m CEPH-MIB.txt -f -C -c /root/snmptrapd/snmptrapd_auth.conf -Of -Lo :162

  7. 스토리지 클러스터에서 경고가 트리거되면 SNMP 관리 호스트의 출력을 모니터링할 수 있습니다. SNMP 트랩과MIB에 의해 디코딩된 트랩을 확인합니다.

    예제

    NET-SNMP version 5.8
     Agent Address: 0.0.0.0
     Agent Hostname: <UNKNOWN>
     Date: 15 - 5 - 12 - 8 - 10 - 4461391
     Enterprise OID: .
     Trap Type: Cold Start
     Trap Sub-Type: 0
     Community/Infosec Context: TRAP2, SNMP v3, user myuser, context
     Uptime: 0
     Description: Cold Start
     PDU Attribute/Value Pair Array:
    .iso.org.dod.internet.mgmt.mib-2.1.3.0 = Timeticks: (292276100) 3 days, 19:52:41.00
    .iso.org.dod.internet.snmpV2.snmpModules.1.1.4.1.0 = OID: .iso.org.dod.internet.private.enterprises.ceph.cephCluster.cephNotifications.prometheus.promMgr.promMgrPrometheusInactive
    .iso.org.dod.internet.private.enterprises.ceph.cephCluster.cephNotifications.prometheus.promMgr.promMgrPrometheusInactive.1 = STRING: "1.3.6.1.4.1.50495.1.2.1.6.2[alertname=CephMgrPrometheusModuleInactive]"
    .iso.org.dod.internet.private.enterprises.ceph.cephCluster.cephNotifications.prometheus.promMgr.promMgrPrometheusInactive.2 = STRING: "critical"
    .iso.org.dod.internet.private.enterprises.ceph.cephCluster.cephNotifications.prometheus.promMgr.promMgrPrometheusInactive.3 = STRING: "Status: critical
    - Alert: CephMgrPrometheusModuleInactive
      Summary: Ceph's mgr/prometheus module is not available
      Description: The mgr/prometheus module at 10.70.39.243:9283 is unreachable. This could mean that the module has been disabled or the mgr itself is down.
    Without the mgr/prometheus module metrics and alerts will no longer function. Open a shell to ceph and use 'ceph -s' to determine whether the mgr is active. If the mgr is not active, restart it, otherwise you can check the mgr/prometheus module is loaded with 'ceph mgr module ls'  and if it's not listed as enabled, enable it with 'ceph mgr module enable prometheus'"

    위 예제에서는 Prometheus 모듈이 비활성화된 후 경고가 생성됩니다.

추가 리소스

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.