### SNMPv3 Configuration Example Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Provides an example of how to configure SNMPv3 user credentials, authentication protocols, and privacy protocols. Multiple user configurations can be defined. ```yaml default_v3: user_name: userNamev3 authentication_protocol: MD5 authentication_passphrase: authPassPrivacy privacy_protocol: AES256 privacy_passphrase: passPrivacy other_v3s: - user_name: test2 authentication_protocol: MD5 authentication_passphrase: authPassPrivacy2 privacy_protocol: AES256 privacy_passphrase: passPrivacy2 - user_name: test3 authentication_protocol: MD5 authentication_passphrase: authPassPrivacy3 privacy_protocol: AES256 privacy_passphrase: passPrivacy3 ``` -------------------------------- ### Example External Device Configuration File Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config This is an example of the content expected within an external device configuration file. It follows the same structure as the inline device configuration, defining device-specific SNMP parameters. ```yaml deviceOne: device_name: router123 device_ip: 10.10.0.201 oid: .1.3.6.1.4.1.2636.1.1.1.2.21.0 snmp_comm: public poll_time_sec: 300 user_tags: owning_team: net_eng environment: production ``` -------------------------------- ### Example SNMP Output Source: https://github.com/kentik/ktranslate/wiki/Collecting-Data-for-Troubleshooting-with-the-snmpwalk-Utility This is an example of a successful response when retrieving the sysOID using snmpwalk. ```bash .1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.9.1.46 ``` -------------------------------- ### YAML Inheritance Example Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Specify other YAML files from which this file should inherit configurations. Ensure all listed files exist at runtime. ```yaml extends: - system-mib.yml - if-mib.yml ``` -------------------------------- ### SNMP Base Configuration Example Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Example of various configuration options available in the snmp-base.yaml file for polling SNMP and flow data devices. ```yaml snmp_hosts: - host: 192.168.1.1 community: public version: 2 ports: - 161 metrics: - name: cpu_usage oid: 1.3.6.1.4.1.9.9.109.1.1.1.1.6 type: gauge description: "CPU Utilization" - name: memory_usage oid: 1.3.6.1.4.1.9.9.109.1.1.1.1.11 type: gauge description: "Memory Utilization" flows: netflow: ports: - 2055 versions: - 9 - host: 192.168.1.2 community: private version: 3 ports: - 161 metrics: - name: interface_traffic oid: 1.3.6.1.2.1.2.2.1.10 type: counter description: "Inbound Interface Traffic" - name: interface_traffic oid: 1.3.6.1.2.1.2.2.1.16 type: counter description: "Outbound Interface Traffic" flows: sflow: ports: - 6343 versions: - 5 # Other configuration options can be added here, such as: # snmp_timeout: 5 # snmp_retries: 3 # log_level: "info" # tls_enabled: false # tls_cert_path: "/etc/ssl/certs/ktranslate.crt" # tls_key_path: "/etc/ssl/private/ktranslate.key" ``` -------------------------------- ### Validate Docker Installation Source: https://github.com/kentik/ktranslate/wiki/New-Relic---VPC-Flow-Logs-Configuration-[Not-currently-supported] Verify that Docker is installed and running by checking its server version. Ensure you have Docker installed and accessible. ```bash docker version --format '{{.Server.Version}}' ``` -------------------------------- ### Example MIB Dump to JSON Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP An example of running mibdump.py to convert the ZSCALER-NSS-MIB to JSON, specifying local paths for librenms and input MIBs. ```bash mibdump.py --mib-source=file:///home/me/src/librenms/mibs --mib-source=file:///tmp/snmp_in --generate-mib-texts --ignore-errors --destination-format json --destination-directory=/tmp/snmp_out ZSCALER-NSS-MIB ``` -------------------------------- ### Global Configuration Example Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Illustrates the global configuration settings for ktranslate, including polling intervals, timeouts, retries, and MIBs to be enabled. Defaults are provided for most options. ```yaml global: poll_time_sec: 300 timeout_ms: 5000 retries: 0 mibs_enabled: - IF-MIB drop_if_outside_poll: false mib_profile_dir: profiles ``` -------------------------------- ### Ktranslate Configuration Using External Devices File Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration This example demonstrates referencing an external YAML file for device definitions. The syntax within the main configuration is '@fileName.yaml'. ```yaml devices: "@neteng-devices.yaml" ``` -------------------------------- ### External Devices File Format Example Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration The external devices file uses the same syntax as the main config's 'devices' section, omitting fields typically generated by discovery. ```yaml devices: # Sample of SNMP v2c device ups_snmpv2c__10.0.0.201: device_name: ups_snmpv2c device_ip: 10.0.0.201 snmp_comm: $YOUR_COMMUNITY_STRING oid: .1.3.6.1.4.1.318.1.3.27 mib_profile: apc_ups.yml provider: kentik-ups poll_time_sec: 300 retries: 1 timeout_ms: 5000 user_tags: owning_team: dc_ops ``` -------------------------------- ### Example Convert JSON MIB to YAML Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Demonstrates converting the ZSCALER-NSS-MIB JSON file to YAML using ktranslate, assuming the JSON file is in /tmp/snmp_out. ```bash docker run --rm -v /tmp/snmp_out:/snmp_out kentik/ktranslate:v2 -snmp /etc/ktranslate/snmp-base.yaml -snmp_json2yaml /snmp_out/ZSCALER-NSS-MIB.json ``` -------------------------------- ### Ktranslate Configuration Using External Discovery CIDRs File Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration This example shows how to reference an external file for discovery CIDRs using the '@fileName.yaml' syntax within the main configuration. ```yaml discovery: cidrs: "@cidrs.yaml" ``` -------------------------------- ### Full Ktranslate Configuration for Meraki Entities Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration This example demonstrates the full set of options required to create Meraki Organization, Network, and Device entities. Ensure all necessary API keys and monitoring preferences are set. ```yaml devices: meraki_dashboard_api: device_name: meraki_controller device_ip: snmp.meraki.com provider: meraki-cloud-controller ext: ext_only: true meraki_config: api_key: $YOUR_MERAKI_API_KEY monitor_devices: true monitor_org_changes: true monitor_uplinks: true monitor_vpn_status: true preferences: device_status_only: true hide_uplink_usage: false show_vpn_peers: true show_network_attr: true trap: {} discovery: {} global: poll_time_sec: 300 timeout_ms: 30000 ``` -------------------------------- ### External CIDR File for Discovery Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Example of using an external file to define CIDR ranges for network discovery. The '@' prefix indicates an external file. ```yaml discovery: cidrs: "@cidrs.yaml" ``` -------------------------------- ### Verify OID in SNMP Profile Configuration Source: https://github.com/kentik/ktranslate/wiki/SNMP-Monitoring-Results-Have-Metrics-Missing Example of how an SNMP profile is configured in `snmp-base.yaml`. Ensure the `mib_profile` value correctly points to the device's profile file. ```yaml devices: deviceOne: ... mib_profile: cisco-catalyst.yml ... ``` -------------------------------- ### 'AND' Match Attributes with Null/Empty Omission Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Configure 'AND' logic for match_attributes by prefixing keys with '!'. This example omits null and empty values. ```yaml devices: deviceName: ... match_attributes: if_Alias: "^Uplink.*" "!if_interface_name": "^Gig.*" ``` -------------------------------- ### Run ktranslate for sFlow Collection Source: https://github.com/kentik/ktranslate/wiki/New-Relic-Flow-Collection-Quickstart Start a ktranslate container in detached mode to listen for sFlow telemetry, send it to New Relic, and log information. Ensure New Relic API key and Account ID are set as environment variables. ```bash docker run -d --name ktranslate-sflow --restart unless-stopped --net=host \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ -e NEW_RELIC_API_KEY=$INSERT_API_KEY \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -nr_account_id=$NR_ACCOUNT_ID \ -metrics=jchf \ -log_level=info \ -tee_logs=true \ -flow_only=true \ -nf.source=sflow \ nr1.flow ``` -------------------------------- ### Output SNMP Data to JSON Source: https://github.com/kentik/ktranslate/wiki/SNMP-Quickstart Starts ktranslate in the foreground to poll SNMP devices and output the collected data in JSON format. ```shell docker run -ti --name ktranslate-snmp --rm --net=host \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ kentik/ktranslate:v2 \ -snmp=/snmp-base.yaml \ -log_level=info \ -format=json ``` -------------------------------- ### View ktranslate Profiling Data Source: https://github.com/kentik/ktranslate/blob/main/README.md Use this command to capture and view profiling data from ktranslate when it's started with the -metalisten flag. Ensure ktranslate is running with -metalisten :6060. ```bash go tool pprof -http :8080 http://127.0.0.1:6060/debug/pprof/profile ``` -------------------------------- ### Example ktranslate SNMP Device Statistics Output Source: https://github.com/kentik/ktranslate/wiki/SNMP-Monitoring-Results-Have-Metrics-Missing This JSON output represents successful collection of device statistics via SNMP by ktranslate. It includes metric names, values, and detailed attributes about the interface and device. ```json [ { "metrics": [ { "name": "kentik.snmp.ifInErrors", "type": "count", "value": 0, "attributes": { "if_Speed": 2, "mib-name": "IF-MIB", "poll_duration_sec": 60, "if_Type": "proppointtopointserial", "if_AdminStatus": "up", "objectIdentifier": ".1.3.6.1.2.1.2.2.1.14", "mib-table": "if", "if_OperStatus": "up", "device_name": "router123", "provider": "kentik-router", "if_interface_name": "Se11/0/0:16", "instrumentation.name": "cisco-asr", "if_Index": "63", "if_Address": "10.201.0.65", "eventType": "KSnmpInterfaceMetric", "if_Netmask": "255.255.255.252", "if_Alias": "pkt.ds1" } } ] } ] ``` -------------------------------- ### Default 'OR' Match Attributes Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Configure 'OR' logic for match_attributes to filter data. This example keeps null and empty values. ```yaml devices: deviceName: ... match_attributes: if_Alias: "^Uplink.*" if_interface_name: "^Gig.*" ``` -------------------------------- ### Build Docker Image for KTranslate Source: https://github.com/kentik/ktranslate/blob/main/README.md Build a Docker image for KTranslate. Ensure you provide your Kentik Account ID and MaxMind License Key as build arguments. ```bash docker build --build-arg YOUR_ACCOUNT_ID=xxxxx --build-arg MAXMIND_LICENSE_KEY=xxxxx -t ktranslate:v2 . ``` -------------------------------- ### Single Match Attribute with Null/Empty Omission Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Configure a single 'AND' match_attribute by prefixing the key with '!'. This example omits null and empty values. ```yaml devices: deviceName: ... match_attributes: "!if_Alias": "^Uplink.*" ``` -------------------------------- ### Include External Device Configuration Files Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Instead of defining devices directly, you can reference external YAML files containing device configurations. This allows for better organization and management of device settings, especially in larger environments. ```yaml devices: - "@networking-devices.yaml" - "@security-devices.yaml" ``` -------------------------------- ### Run ktranslate with Custom SNMP Profiles Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Launch ktranslate in Docker, mounting your custom profiles directory and specifying the base SNMP configuration file. ```bash docker run -ti --name ktranslate --rm --net=host \ -v `pwd`/my_custom_profiles:/etc/profiles/my_custom_profiles -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ kentik/ktranslate:v2 \ -snmp=/snmp-base.yaml \ -log_level=info \ -format=json ``` -------------------------------- ### Create and Copy SNMP Config Source: https://github.com/kentik/ktranslate/wiki/SNMP-Quickstart Creates a ktranslate container, copies the base SNMP configuration file, and then removes the container. ```shell cd . id=$(docker create kentik/ktranslate:v2) docker cp $id:/etc/ktranslate/snmp-base.yaml . docker rm -v $id ``` -------------------------------- ### Run InfluxDB and ktranslate Stack Source: https://github.com/kentik/ktranslate/blob/main/hack/influxdb/README.md Launches all services defined in the Docker Compose file. Access InfluxDB at http://localhost:8086 with user 'admin' and password 'influxdb'. ```bash docker compose up ``` -------------------------------- ### Run KTranslate with Latest Version (v2) Source: https://github.com/kentik/ktranslate/wiki/Managing-KTranslate-Container-Versions Use this command to run the KTranslate container, pulling the latest release tagged as 'v2'. Ensure `--pull=always` is included to guarantee the latest version is used. ```shell docker run -d --name ktranslate-SNMP --restart unless-stopped --pull=always -p 162:1620/udp \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ -e NEW_RELIC_API_KEY=$YOUR_LICENSE_KEY \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -nr_account_id=$YOUR_ACCOUNT_ID \ -metrics=jchf \ -tee_logs=true \ -service_name=SNMP \ -snmp_discovery_on_start=true \ -snmp_discovery_min=180 \ nr1.snmp ``` -------------------------------- ### Multiple SNMPv3 Profiles Configuration Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Enable discovery with multiple SNMPv3 profiles by using the `discovery.other_v3s` key, which accepts an array of configurations. ```yaml discovery: other_v3s: - user_name: $YOUR_USER_NAME_1 authentication_protocol: $YOUR_AUTHENTICATION_PROTOCOL_1 authentication_passphrase: $YOUR_AUTHENTICATION_PASSPHRASE_1 privacy_protocol: $YOUR_PRIVACY_PROTOCOL_1 privacy_passphrase: $YOUR_PRIVACY_PASSPHRASE_1 context_engine_id: "" context_name: "" - user_name: $YOUR_USER_NAME_2 authentication_protocol: $YOUR_AUTHENTICATION_PROTOCOL_2 authentication_passphrase: $YOUR_AUTHENTICATION_PASSPHRASE_2 privacy_protocol: $YOUR_PRIVACY_PROTOCOL_1 privacy_passphrase: $YOUR_PRIVACY_PASSPHRASE_2 context_engine_id: "" context_name: "" ``` -------------------------------- ### Custom Application Mapping for Flow Data Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Override default application mapping for flow data by providing a YAML file to the -application_map flag. This example maps ports to application names. ```yaml applications: - ports: [9092, 9093] name: kafka - ports: [80, 8080] name: http - ports: [443, 8443] name: https ``` -------------------------------- ### YAML Hexadecimal to Integer Conversion Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Specify data conversion for hexadecimal SNMP values. This example converts a hex string to an unsigned 16-bit integer using Big-Endian byte order. ```yaml - column: OID: 1.3.6.1.2.1.75.1.2.1.1.1 name: portIndex tag: port_index conversion: hextoint:BigEndian:uint16 ``` -------------------------------- ### View ktranslate Targeted Poll Logs Source: https://github.com/kentik/ktranslate/wiki/SNMP-Monitoring-Results-Have-Metrics-Missing Follow the logs of the ktranslate container started with the '-snmp_poll_now' flag to view the results of the targeted SNMP poll. This helps in debugging data collection issues. ```shell docker logs --follow ktranslate-poll_now ``` -------------------------------- ### Run SNMP Discovery Source: https://github.com/kentik/ktranslate/wiki/SNMP-Quickstart Executes ktranslate in discovery mode to find SNMP devices based on configured CIDRs and community strings. Requires New Relic Account ID and Insights Insert Key. Note: This feature is not available for Free Tier New Relic accounts. ```shell docker run -ti --name ktranslate-discovery --rm --net=host \ --user `id -u`:`id -g` \ -e NEW_RELIC_API_KEY=$NR_INSIGHTS_INSERT_KEY \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -tee_logs=true \ -nr_account_id=$NR_ACCOUNT_ID \ -snmp_discovery=true ``` -------------------------------- ### Network Discovery Configuration Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Configure network discovery settings, including target CIDRs, ports, default SNMP communities, and discovery behavior options like adding devices and threads. ```yaml discovery: cidrs: "@cidrs.yaml" debug: false ports: - 161 default_communities: - public default_v3: null add_devices: true threads: 4 use_snmp_v1: false replace_devices: true ``` -------------------------------- ### Download KTranslate Docker Image Source: https://github.com/kentik/ktranslate/wiki/Firehose-Quickstart Use this command to pull the latest v2 KTranslate Docker image. ```bash docker pull kentik/ktranslate:v2 ``` -------------------------------- ### Directory Structure for SNMP Profiles Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Illustrates the expected directory structure for custom SNMP profiles, including a placeholder for a timestamp file to trigger reloads. ```text . └── /snmp-profiles/ └── profiles/ └── kentik-snmp/ ├── 3com ├── _general ├── a10networks └── ... ``` ```text . └── /snmp-profiles/ ├── last_updated.txt └── profiles/ └── kentik-snmp/ ├── 3com ├── _general ├── a10networks └── ... ``` -------------------------------- ### Docker Image Tagging and Pushing Source: https://github.com/kentik/ktranslate/wiki/AWS-VPC-Flow-Logs Commands to pull the ktranslate Docker image, tag it for your private ECR registry, and push it. Ensure your AWS CLI is configured. ```bash docker pull kentik/ktranslate:v2 docker tag kentik/ktranslate:v2 451031991406.dkr.ecr.us-east-1.amazonaws.com/ktranslate:v2 docker push 451031991406.dkr.ecr.us-east-1.amazonaws.com/ktranslate:v2 ``` -------------------------------- ### Docker Mount Argument for External Configuration Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration This command snippet shows how to mount external configuration files into a Docker container. Use one `-v` argument per file. ```bash -v `pwd`/fileName.yaml:/fileName.yaml \ ``` -------------------------------- ### YAML Sysobjectid Matching (List) Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Provide a list of system object IDs for profile matching. This allows a single configuration to apply to multiple device types. ```yaml sysobjectid: - 1.3.6.1.4.1.9.1.111 - 1.3.6.1.4.1.9.1.170 ``` -------------------------------- ### KTranslate Command-Line Flags Source: https://github.com/kentik/ktranslate/blob/main/README.md Overview of available command-line flags for configuring KTranslate's behavior, including input/output formats, network settings, and enrichment options. ```bash Usage of ./bin/ktranslate: -api_device_file string File to sideload devices without hitting API -api_devices string json file containing dumy devices to use for the stub Kentik API -api_root string API url prefix. If not set, defaults to https://api.kentik.com (default "https://api.kentik.com") -application_map string File containing custom application mappings -asn string Asn mapping file -aws_lambda Run as a AWS Lambda function -aws_local_file string If set, process this local file and exit -aws_regions string CSV list of region to run in. Will look for metadata in all regions, run SQS in first region. (default "us-east-1") -bootstrap.servers string bootstrap.servers -compression string compression algo to use (none|gzip|snappy|deflate|null) (default "none") -dns string Resolve IPs at this ip:port -enricher string Send data to this http url for enrichment. -file_flush_sec int Create a new output file every this many seconds (default 60) -file_on If true, start writting to file sink right away. Otherwise, wait for a USR1 signal -file_out string Write flows seen to log to this directory if set (default "./") -filters value Any filters to use. Format: type dimension operator value -flow_only If true, don't poll snmp devices. -format string Format to convert kflow to: (json|flat_json|avro|netflow|influx|prometheus|new_relic|new_relic_metric|elasticsearch|kflow) (default "flat_json") -format_rollup string Format to convert rollups to: (json|avro|netflow|influx|prometheus|new_relic|new_relic_metric|elasticsearch|kflow) -gcloud_bucket string GCloud Storage Bucket to write flows to -gcloud_content_type string GCloud Storage Content Type (default "application/json") -gcloud_prefix string GCloud Storage object prefix (default "/kentik") -gcp.project string Google ProjectID to listen for flows on -gcp.sub string Google Sub to listen for flows on -gcp_pubsub_project_id string GCP PubSub Project ID to use -gcp_pubsub_topic string GCP PubSub Topic to publish to -geo string Geo mapping file -http.source Listen for content sent via http. -http_header value Any custom http headers to set on outbound requests -http_url string URL to post to (default "http://localhost:8086/write?db=kentik") -iam_role string IAM Role to use for processing flow -info_collector Also send stats about this collector -input_threads int Number of threads to run for input processing -kafka_topic string kafka topic to produce on -kentik_email string Kentik email to use for API calls -kentik_plan int Kentik plan id to use for creating devices -kentik_relay_url string If set, override the kentik api url to send flow over here. -listen string IP:Port to listen on (default "127.0.0.1:8081") -log_level string Logging Level (default "info") -mapping string Mapping file to use for enums -max_before_sample int Only sample when a set of inputs is at least this many (default 1) -max_flows_per_message int Max number of flows to put in each emitted message (default 10000) -max_threads int Dynamically grow threads up to this number -metalisten string HTTP interface and port to bind on -metrics string Metrics Configuration. none|syslog|stderr|graphite:127.0.0.1:2003 (default "none") -net_protocol string Use this protocol for writing data (udp|tcp|unix) (default "udp") -net_server string Write flows seen to this address (host and port) -netflow_version string Version of netflow to produce: (netflow9|ipfix) (default "ipfix") -nf.addr string Sflow/NetFlow/IPFIX listening address (default "0.0.0.0") -nf.mapping string Configuration file for custom netflow mappings -nf.message.fields string ``` -------------------------------- ### Verify Custom Profile Loading Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Check ktranslate logs for confirmation that your custom profile was found and matched to a sysoid. ```log 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate Found profile for 1.3.6.1.4.1.9.12.3.1.3.1812: cisco-nexus.yml ``` -------------------------------- ### Configure Azure Key Vault Integration Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Set environment variables for Docker to authenticate and access secrets from Azure Key Vault. Ensure you set either KT_AZURE_KEY_VAULT_NAME or KT_AZURE_KEY_VAULT_URL. ```bash docker run -d --name ktranslate-$CONTAINER_SERVICE --restart unless-stopped --pull=always -p 162:1620/udp \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ -e KT_AZURE_KEY_VAULT_NAME=$YOUR_KEY_VAULT_NAME \ #### Optional: Provide the full URL to target # -e KT_AZURE_KEY_VAULT_URL=$YOUR_KEY_VAULT_URL \ -e AZURE_CLIENT_ID=$YOUR_CLIENT_ID \ -e AZURE_CLIENT_SECRET=$YOUR_CLIENT_SECRET \ -e AZURE_TENANT_ID=$YOUR_TENANT_ID \ -e AZURE_SUBSCRIPTION_ID=$YOUR_SUBSCRIPTION_ID \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -metrics=jchf \ -tee_logs=true \ -service_name=$CONTAINER_SERVICE \ -snmp_discovery_on_start=true \ -snmp_discovery_min=180 ``` -------------------------------- ### Configure GCP Secret Manager Integration Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration Configure Docker to use GCP Secret Manager by mounting a service account key file and setting environment variables for authentication and project ID. ```bash docker run -d --name ktranslate-$CONTAINER_SERVICE --restart unless-stopped --pull=always -p 162:1620/udp \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ -v $YOUR_LOCAL_SERVICE_ACCOUNT_KEY_FILE_PATH:/gcp_snmp_sa_key.json \ -e GOOGLE_APPLICATION_CREDENTIALS='./gcp_snmp_sa_key.json' \ -e GOOGLE_CLOUD_PROJECT=$YOUR_PROJECT_ID \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -metrics=jchf \ -tee_logs=true \ -service_name=$CONTAINER_SERVICE \ -snmp_discovery_on_start=true \ -snmp_discovery_min=180 ``` -------------------------------- ### View Applied Custom Interface Metrics Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Review log output to see the specific custom interface metrics that ktranslate will poll based on your configuration. ```log 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding custom interface metadata oid: 1.3.6.1.2.1.31.1.1.1.1 -> ifName 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding interface metric .1.3.6.1.2.1.31.1.1.1.13 -> ifHCOutBroadcastPkts 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding interface metric .1.3.6.1.2.1.2.2.1.8 -> ifOperStatus 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding interface metric .1.3.6.1.2.1.2.2.1.13 -> ifInDiscards 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding interface metric .1.3.6.1.2.1.2.2.1.20 -> ifOutErrors 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Using custom interface metric set ``` -------------------------------- ### Capture Full SNMP v3 Walk Source: https://github.com/kentik/ktranslate/wiki/Collecting-Data-for-Troubleshooting-with-the-snmpwalk-Utility Redirect the output of a full SNMP v3 walk to a file. This process can take a significant amount of time on devices with many interfaces. ```bash snmpwalk -v 3 -l $LEVEL -u $USERNAME -a $AUTH_PROTOCOL -A $AUTH_PASSPHRASE -x $PRIV_PROTOCOL -X $PRIV_PASSPHRASE -ObentU -Cc $IP_ADDRESS . >> snmpwalk.out ``` -------------------------------- ### Force SNMP Profile Mapping with '!' Syntax Source: https://github.com/kentik/ktranslate/wiki/Discovery-maps-to-unexpected-profile Use the '!' prefix followed by the profile name to manually assign a profile to a device during SNMP discovery. This overrides the automatic matching process. ```yaml mib_profile: "!sonicwall-sma.yml" provider: kentik-firewall ``` -------------------------------- ### Run KTranslate for NetFlow/sFlow Data Source: https://github.com/kentik/ktranslate/wiki/Firehose-Quickstart This command runs KTranslate to process NetFlow data. Ensure NEW_RELIC_API_KEY and NR_ACCOUNT_ID environment variables are set. Mount a snmp-base.yaml file for configuration. ```bash docker run \ -e NEW_RELIC_API_KEY=NRII-$NR_TOKEN \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ --net=host \ --name ktranslate \ kentik/ktranslate:v2 \ -nr_account_id $NR_ACCOUNT_ID \ -metrics=jchf \ -snmp=/snmp-base.yaml \ -tee_logs=true \ -nf.source=netflow5 \ -nf.port=9995 \ -flow_only=true \ nr1.flow ``` -------------------------------- ### Basic SNMP Trap Configuration Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Configure the listening address and community string for receiving SNMP traps. Leave version and transport empty to use defaults. ```yaml trap: listen: 127.0.0.1:162 community: public version: "" transport: "" ``` -------------------------------- ### Run ktranslate Docker Container for GCP VPC Flow Export Source: https://github.com/kentik/ktranslate/wiki/GCP-VPC This command runs the ktranslate Docker container to listen to a GCP Pub/Sub subscription for VPC flow logs and export them to New Relic. Ensure environment variables like NR_INSIGHTS_INSERT_KEY, PROJECT_NAME, SUBSCRIPTION_NAME, and NR_ACCOUNT_ID are set. ```bash docker run -ti --rm kentik/ktranslate:v2 \ -e NEW_RELIC_API_KEY=$NR_INSIGHTS_INSERT_KEY \ -vpc gcp \ -gcp.project $PROJECT_NAME \ -gcp.sub $SUBSCRIPTION_NAME \ -nr_account_id=$NR_ACCOUNT_ID \ --tee_logs \ -metrics=jchf \ nr1.vpc ``` -------------------------------- ### View Custom Device Metadata Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Inspect log output to see the custom device metadata that ktranslate has identified and is preparing to poll. ```log 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Custom device metadata 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.1.2.0 -> sysObjectID 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.1.5.0 -> sysName 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.1.1.0 -> sysDescr ``` -------------------------------- ### Enable MIBs for New Device Profiles Source: https://github.com/kentik/ktranslate/wiki/Discovery-maps-to-unexpected-profile Add MIB names to the `mibs_enabled` list in your global configuration to ensure the running container actively collects metrics for those MIBs, especially after manually overriding a profile. ```yaml mibs_enabled: - HOST-RESOURCES-MIB - IF-MIB - SONICWALL-SMA-APPLIANCE-SYSTEM-HEALTH-MIB - SONICWALL-SMA-APPLIANCE-SERVICE-HEALTH-MIB - SONICWALL-SMA-APPLIANCE-SECURITY-HISTORY-MIB - SONICWALL-SMA-APPLIANCE-TUNNEL-SERVER-MIB ``` -------------------------------- ### Run KTranslate for AWS VPC Logs Source: https://github.com/kentik/ktranslate/wiki/Firehose-Quickstart This command runs KTranslate to send AWS VPC logs to New Relic. It requires the New Relic API key and account ID, and specifies the SQS queue name. ```bash docker run \ -e NEW_RELIC_API_KEY=NRII-$NR_TOKEN \ -p 8082:8082 \ kentik/ktranslate:v2 \ -nr_account_id $NR_ACCOUNT_ID \ -metrics=jchf \ -vpc=aws \ -sqs_name=sqs-queue-name \ -tee_logs=true \ nr1.vpc ``` -------------------------------- ### Configure Devices Section in YAML Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config Use this configuration block to define individual devices for SNMP polling. Specify essential details like device name, IP address, OID, and SNMP community string. Optional parameters like poll time and user tags can also be set. ```yaml devices: deviceOne: device_name: router123 device_ip: 10.10.0.201 oid: .1.3.6.1.4.1.2636.1.1.1.2.21.0 snmp_comm: public poll_time_sec: 300 user_tags: owning_team: net_eng environment: production match_attributes: if_Description: "^igb|^eth" ``` -------------------------------- ### View Custom Interface Metadata Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Examine log entries to confirm the custom interface metadata OIDs that ktranslate has recognized. ```log 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Custom interface metadata 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.31.1.1.1.15 -> ifHighSpeed 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.31.1.1.1.1 -> ifName 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart -> : 1.3.6.1.2.1.31.1.1.1.18 -> ifAlias ``` -------------------------------- ### Aggregated SNMP Base Configuration Source: https://github.com/kentik/ktranslate/wiki/Sample-SNMP-config This snippet shows a complete 'snmp-base.yaml' configuration. It includes settings for individual devices, trap reception, network discovery, and global parameters like polling intervals and timeouts. ```yaml devices: deviceOne: device_name: router123 device_ip: 10.10.0.201 oid: .1.3.6.1.4.1.2636.1.1.1.2.21.0 snmp_comm: public poll_time_sec: 300 user_tags: owning_team: net_eng environment: production trap: listen: 127.0.0.1:162 community: public version: "" transport: "" v3_config: discovery: cidrs: - 10.10.0.0/24 - 10.20.0.0/24 - 192.168.0.21/32 debug: false ports: - 161 - 1161 default_communities: - public default_v3: null add_devices: true threads: 4 use_snmp_v1: false replace_devices: true global: poll_time_sec: 300 timeout_ms: 5000 retries: 0 mibs_enabled: - IF-MIB drop_if_outside_poll: false mib_profile_dir: profiles ``` -------------------------------- ### YAML Sysobjectid Matching (Wildcard) Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Use a wildcard to match system object IDs that share a common prefix. This is useful for broad device type matching. ```yaml sysobjectid: 1.3.6.1.4.1.25461.* ``` -------------------------------- ### Run ktranslate for AWS VPC Flow Logs to New Relic Source: https://github.com/kentik/ktranslate/wiki/New-Relic---VPC-Flow-Logs-Configuration-[Not-currently-supported] Execute ktranslate in a Docker container to ingest AWS VPC Flow Logs and send them to New Relic. Ensure New Relic API Key, Account ID, SQS queue URL, IAM role, and AWS regions are correctly set as environment variables and arguments. ```bash docker run --name ktranslate -d \ -e NEW_RELIC_API_KEY=$NR_INSIGHTS_INSERT_KEY \ -p 8083:8083 \ kentik/ktranslate:v2 \ -nr_account_id=$NR_ACCOUNT_ID \ -vpc=aws \ -sqs_name=$AWS_QUEUE \ -iam_role=$AWS_ROLE \ -aws_regions=$REGIONS \ nr1.vpc ``` -------------------------------- ### SNMP v3 Parameters Source: https://github.com/kentik/ktranslate/wiki/Collecting-Data-for-Troubleshooting-with-the-snmpwalk-Utility These variables must be replaced with your specific SNMP v3 configuration details when testing connectivity or capturing data. ```bash $LEVEL == noAuthNoPriv | authNoPriv | authPriv $USERNAME == SNMP v3 User $AUTH_PROTOCOL == MD5 | SHA $AUTH_PASSPHRASE == Authentication passphrase $PRIV_PROTOCOL == DES | AES $PRIV_PASSPHRASE == Privacy passphrase $IP_ADDRESS == target device IP ``` -------------------------------- ### Convert JSON MIB to YAML with ktranslate Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Use ktranslate in Docker to convert a JSON file generated from a MIB into a YAML configuration file. ```bash docker run --rm -v /tmp/snmp_out:/snmp_out kentik/ktranslate:v2 -snmp /etc/ktranslate/snmp-base.yaml -snmp_json2yaml /snmp_out/MY_MIB_NAME.json ``` -------------------------------- ### View Applied Custom Device Metrics Source: https://github.com/kentik/ktranslate/wiki/Tutorial:-Writing-a-custom-yaml-file-for-SNMP Check the logs to confirm the custom device metrics that ktranslate will collect. ```log 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding device metric .1.3.6.1.4.1.9.9.305.1.1.1 -> CPU 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding device metric .1.3.6.1.4.1.9.9.305.1.1.2.0 -> MemoryUtilization 2021-07-20T15:29:31.542 ktranslate(294299) [Info] KTranslate>bart Adding device metric .1.3.6.1.2.1.7.8.0 -> udpHCInDatagrams ``` -------------------------------- ### Docker Run Command with AWS Secrets Manager Source: https://github.com/kentik/ktranslate/wiki/Advanced-Ktranslate-Configuration This command demonstrates how to run the ktranslate Docker container, configuring it to use AWS Secrets Manager for credentials. Ensure the AWS environment variables are set in your Docker runtime. ```bash docker run -d --name ktranslate-$CONTAINER_SERVICE --restart unless-stopped --pull=always -p 162:1620/udp \ -v `pwd`/snmp-base.yaml:/snmp-base.yaml \ -e AWS_ACCESS_KEY_ID=$YOUR_AWS_ACCESS_KEY_ID \ -e AWS_SECRET_ACCESS_KEY=$YOUR_AWS_SECRET_ACCESS_KEY \ -e AWS_REGION=$YOUR_AWS_REGION \ kentik/ktranslate:v2 \ -snmp /snmp-base.yaml \ -metrics=jchf \ -tee_logs=true \ -service_name=$CONTAINER_SERVICE \ -snmp_discovery_on_start=true \ -snmp_discovery_min=180 ```