Skip to content

Infrastructure Integration

Configuration

  1. Configure the agent by editing /etc/nutanix/epoch-dd-agent/conf.d/snmp.yamlin the collectors.

Example:

    init_config:
    #    #You can specify an additional folder for your custom mib files (python format)
    #    mibs_folder: /path/to/your/mibs/folder
    #    ignore_nonincreasing_oid: False

    instances:

      # SNMP v1-v2 configuration
      #
      # - ip_address: localhost
      #   port: 161
      #   community_string: public
      #   snmp_version: 2 # Only required for snmp v1, will default to 2
      #   timeout: 1 # second, by default
      #   retries: 5
      #   enforce_mib_constraints: true  # if set to false we will not check the values
      #                                  # returned meet the MIB constraints. Defaults to True.
      #   tags:
      #     - optional_tag_1
      #     - optional_tag_2
      #
      #   # Specify metrics you want to monitor
      #   metrics:
      #     # You can specify metrics using MIBS (Counter and Gauge)
      #     - MIB: UDP-MIB
      #       symbol: udpInDatagrams
      #     - MIB: TCP-MIB
      #       symbol: tcpActiveOpens
      #     # If it's just a scalar, you can specify by OID and name it
      #     - OID: 1.3.6.1.2.1.6.5
      #       name: tcpPassiveOpens
      #     
      #     # You can also specify a specific tag for these with the metric_tags field
      #     - OID: 1.3.6.1.2.1.6.5
      #       name: tcpPassiveOpens
      #       metric_tags:
      #         - TCP
      #
      #     # This monitor auto-detects OID data types from the remote agent's response.
      #     # If you're dealing with a buggy agent that returns incorrect data types for OIDs,
      #     # You can force the data type with the 'forced_type' parameter.  Valid options for
      #     # this parameter are 'gauge' and 'counter'.
      #     # Example: When a F5 Networks load balancer is queried for this OID, it will return
      #     # it as a Counter64 when it should be a gauge.  So, we force the data type to gauge:
      #     - OID: 1.3.6.1.4.1.3375.2.1.1.2.1.8.0
      #       name: F5_TotalCurrentConnections
      #       forced_type: gauge
      #
      #     # You can also query a table and specify
      #     #   - which columns to report as value (symbols)
      #     #   - which columns / indexes to use as tags (metric_tags)
      #     - MIB: IF-MIB
      #       table: ifTable
      #       symbols:
      #         - ifInOctets
      #         - ifOutOctets
      #       metric_tags:
      #         - tag: interface
      #           column: ifDescr  # specify which column to read the tag value from
      #     - MIB: IP-MIB
      #       table: ipSystemStatsTable
      #       symbols:
      #         - ipSystemStatsInReceives
      #       metric_tags:
      #         - tag: ipversion
      #           index: 1        # specify which index you want to read the tag value from

      # SNMP v3 configuration
      # check http://pysnmp.sourceforge.net/docs/current/security-configuration.html
      #
      # - ip_address: 192.168.34.10
      #   # port: 161 # default value
      #   user: user
      #   authKey: password
      #   privKey: private_key
      #   authProtocol: authProtocol
      #   privProtocol: privProtocol
      #   timeout: 1 # second, by default
      #   retries: 5
      #   tags:
      #     - optional_tag_1
      #     - optional_tag_2
      #   metrics:
      #     - MIB: UDP-MIB
      #       symbol: udpInDatagrams
      #     - MIB: TCP-MIB
      #       symbol: tcpActiveOpens
  1. Check and make sure that all yaml files are valid with following command:

    /etc/init.d/epoch-collectors configcheck
    
  2. Restart the Agent using the following command:

    /etc/init.d/epoch-collectors restart
    
  3. Execute the info command to verify that the integration check has passed:

    /etc/init.d/epoch-collectors info
    

The output of the command should contain a section similar to the following:

    Checks
    ======

      [...]

      snmp
      ----
          - instance #0 [OK]
          - Collected 8 metrics & 0 events

USING YOUR OWN MIB

To use your own MIB with the EPOCH Agent, convert it to the PySNMP format. This can be done using the mibdump.py script that ships with PySNMP. The mibdump.py tool is a command-line frontend to the PySMI library. This tool can be used for automatic downloading and transforming SNMP MIB modules into various formats.

$ mibdump.py --help

Synopsis:

 SNMP SMI/MIB files conversion tool

Documentation:

 http://snmplabs.com/pysmi

Usage: mibdump.py [--help]

     [--version]

     [--quiet]

     [--debug=<all|borrower|codegen|compiler|grammar|lexer|parser|reader|searcher|writer>]

     [--mib-source=<URI>]

     [--mib-searcher=<PATH|PACKAGE>]

     [--mib-stub=<MIB-NAME>]

     [--mib-borrower=<PATH>]

     [--destination-format=<FORMAT>]

     [--destination-directory=<DIRECTORY>]

     [--cache-directory=<DIRECTORY>]

     [--disable-fuzzy-source]

     [--no-dependencies]

     [--no-python-compile]

     [--python-optimization-level]

     [--ignore-errors]

     [--build-index]

     [--rebuild]

     [--dry-run]

     [--no-mib-writes]

     [--generate-mib-texts]

     [--keep-texts-layout]

     <MIB-NAME> [MIB-NAME [...]]]

Where:

   URI     - file, zip, http, https, ftp, sftp schemes are supported.

          Use @mib@ placeholder token in URI to refer directly to

          the required MIB module when source does not support

          directory listing (e.g. HTTP).

   FORMAT   - pysnmp, json, null

In Linux, find the location of mibdump.py, run:

$ find /opt/nutanix/epoch/ -type f -name mibdump.py

/opt/nutanix/epoch/collectors/embedded/bin/mibdump.py

In Linux, use this format for the script:

<PATH_TO_FILE>/mibdump.py \
  --mib-source <PATH_TO_MIB_FILES> \
  --mib-source http://mibs.snmplabs.com/asn1/@mib@ \
  --destination-directory=<PATH_TO_CONVERTED_MIB_PYFILES> \
  --destination-format=pysnmp <MIB_FILE_NAME>

Example using the CISCO-TCP-MIB.my:

# /opt/nutanix/epoch/collectors/embedded/bin/mibdump.py
--mib-source <PATH_TO_MIB_FILE>  --mib-source http://mibs.snmplabs.com/asn1/@mib@ --destination-directory=/opt/nutanix/epoch/collectors/pysnmp/custom_mibpy/ --destination-format=pysnmp CISCO-TCP-MIB

Source MIB repositories: <PATH_TO_MIB_FILE>, http://mibs.snmplabs.com/asn1/@mib@
 Borrow missing/failed MIBs from: http://mibs.snmplabs.com/pysnmp/notexts/@mib@
 Existing/compiled MIB locations: pysnmp.smi.mibs, pysnmp_mibs
 Compiled MIBs destination directory: /opt/nutanix/epoch/collectors/pysnmp/custom_mibpy/
 MIBs excluded from code generation: INET-ADDRESS-MIB, PYSNMP-USM-MIB, RFC-1212, RFC-1215, RFC1065-SMI, RFC1155-SMI, RFC1158-MIB, RFC1213-MIB, SNMP-FRAMEWORK-MIB, SNMP-TARGET-MIB, SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC, SNMPv2-TM, TRANSPORT-ADDRESS-MIB
 MIBs to compile: CISCO-TCP
 Destination format: pysnmp
 Parser grammar cache directory: not used
 Also compile all relevant MIBs: yes
 Rebuild MIBs regardless of age: no
 Dry run mode: no Create/update MIBs: yes
 Byte-compile Python modules: yes (optimization level no)
 Ignore compilation errors: no
 Generate OID->MIB index: no
 Generate texts in MIBs: no
 Keep original texts layout: no
 Try various file names while searching for MIB module: yes
 Created/updated MIBs: CISCO-SMI, CISCO-TCP-MIB (CISCO-TCP)
 Pre-compiled MIBs borrowed:
 Up to date MIBs: INET-ADDRESS-MIB, SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC, TCP-MIB
 Missing source MIBs:
 Ignored MIBs:
 Failed MIBs:

 #ls /opt/nutanix/epoch/collectors/pysnmp/custom_mibpy/
CISCO-SMI.py CISCO-SMI.pyc CISCO-TCP-MIB.py CISCO-TCP-MIB.pyc

The EPOCH Agent looks for the converted MIB Python files by specifying the destination path with mibs_folder in the SNMP YAML configuration.

Restart the Agent to start sending SNMP metrics to EPOCH