### Install Dependencies Source: https://github.com/intel/intel-pmt/blob/main/tools/collectd-agent/Readme.md Install the required Python packages for the Intel PMT agent. These are necessary for the agent to function correctly. ```bash pip install lxml pip install requests pip install urllib3 ``` -------------------------------- ### Clone Intel PMT Repository Source: https://github.com/intel/intel-pmt/blob/main/docs/getting-started.md Clone the Intel PMT repository and navigate into the directory. This is the first step to start using the tools. ```bash git clone https://github.com/intel/Intel-PMT.git cd Intel-PMT ``` -------------------------------- ### Build Docker Image for Intel PMT Source: https://github.com/intel/intel-pmt/blob/main/tools/docker/Readme.md Builds the Docker image named 'pmt'. Ensure you have a working Docker installation and the otelcol-contrib binary. ```bash chmod a+x tools/docker/entrypoint.sh docker build -f tools/docker/Dockerfile -t pmt . ``` -------------------------------- ### Install Inventory Converter Package Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md Installs the inventory converter Python package and its dependencies using pip. ```bash pip3 install . ``` -------------------------------- ### Collect Telemetry Data Source: https://github.com/intel/intel-pmt/blob/main/tools/collectd-agent/Readme.md Example command to run the PMT agent and collect telemetry data. Ensure the path to the pmt.xml metadata file is correct. ```bash sudo python pmt.py -s file:///home/user/Intel-PMT/xml/pmt.xml ``` -------------------------------- ### OpenTelemetry Collector Logs Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Example log output from the OpenTelemetry Collector during startup and operation. Shows service initialization, component loading, and metric processing. ```text 2025-02-12T16:42:52.648-0700 info service@v0.123.0/service.go:186 Setting up own telemetry... 2025-02-12T16:42:52.648-0700 info builders/builders.go:26 Development component. May change in the future. {"kind": "exporter", "data_type": "metrics", "name": "debug"} 2025-02-12T16:42:52.649-0700 info service@v0.123.0/service.go:252 Starting otelcol-pmt.exe... {"Version": "0.123.0-pmt", "NumCPU": 20} 2025-02-12T16:42:52.649-0700 info extensions/extensions.go:39 Starting extensions... 2025-02-12T16:42:52.649-0700 info otlpreceiver@v0.123.0/otlp.go:112 Starting GRPC server {"kind": "receiver", "name": "otlp", "data_type": "metrics", "endpoint": "0.0.0.0:4317"} 2025-02-12T16:42:52.651-0700 info service@v0.123.0/service.go:275 Everything is ready. Begin running and processing data. 2025-02-12T16:43:07.308-0700 info Metrics {"kind": "exporter", "data_type": "metrics", "name": "debug", "resource metrics": 32098, "metrics": 32098, "data points": 32098} ``` -------------------------------- ### YAML Metadata Example for Version 0 Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md This YAML structure defines metric metadata for version 0 of the inventory converter. It specifies sensor type mappings and whether metrics should be exposed as Redfish sensors. ```yaml metric_metadata: - metric: "CPU.Core.Temperature" sensor_type: "Temperature" is_redfish_sensor: true - metric: "CPU.Core.Utilization" sensor_type: "Utilization" is_redfish_sensor: false ``` -------------------------------- ### Incorrect YAML Metadata Example (Version 1) Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md Illustrates a common mistake in version 1 YAML metadata where an aggregator is incorrectly used as a data source for Kafka streaming. ```yaml # (...) 474: #WRONG YAML metadata ! type: Count kafkaStream: # As aggregator cannot be data source of Kafka streaming - Aggregator # this config won't work redfishSensor: # Data source of Redfish sensor can be empty and it just means that # this metric won't be published using Redfish sensor # (...) ``` -------------------------------- ### Get Base64 Credentials using curl Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Use curl in verbose mode to obtain Base64 encoded credentials for BMC authentication. The output will include the Authorization header. ```bash curl -v -k -u username:password https://bmc_ip/ ``` -------------------------------- ### Run Inventory Converter (Command Line) Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md Executes the inventory converter with specified input files and version. Replace placeholders with actual file paths and version number. ```bash inventory-converter -i $(path_to_aggregator_interface).xml \ -s $(path_to_avro_schema).avsc \ -t $(path_to_metadata).yaml \ -o $(output_file).avro \ -v $(version) # Where each $(name) shall be replaced with proper path to input file and # for version with two possibles: 1 or 0. ``` -------------------------------- ### Run Python Agent (Basic) Source: https://github.com/intel/intel-pmt/blob/main/docs/getting-started.md Execute the Python agent to collect telemetry data. Ensure you have the correct XML configuration file path. ```bash sudo python tools/collectd-agent/pmt.py -s file://$(pwd)/xml/pmt.xml -r ``` -------------------------------- ### Collect Local Aggregators with Python Source: https://github.com/intel/intel-pmt/blob/main/Readme.md Clone the repository, navigate to the Intel-PMT directory, and run the Python script to collect local aggregators. This requires specifying the XML configuration file and the reporting mode. ```bash git clone https://github.com/intel/Intel-PMT.git cd Intel-PMT sudo python tools/collectd-agent/pmt.py -s file://$(pwd)/xml/pmt.xml -r ``` -------------------------------- ### Run OpenTelemetry Collector (Local Mode) Source: https://github.com/intel/intel-pmt/blob/main/docs/getting-started.md Execute the OpenTelemetry Collector in local mode using a provided configuration file. Ensure you are in the build directory. ```bash cd tools/otel/build ./otelcol-pmt --config ../configs/config-example-pmt-local.yaml ``` -------------------------------- ### Build and Run Custom OpenTelemetry Collector Source: https://github.com/intel/intel-pmt/blob/main/Readme.md Navigate to the tools/otel directory and build the custom OpenTelemetry collector using ocb. Then, run the collector with a specified configuration file for PMT integration. ```bash cd tools/otel # Build via ocb (see tools/otel/Readme.md) ./build/otelcol-pmt --config configs/config-example-pmt-local.yaml ``` -------------------------------- ### Run Python Agent (Interval Streaming) Source: https://github.com/intel/intel-pmt/blob/main/docs/getting-started.md Run the Python agent with a specified interval for streaming telemetry data. Refer to the agent's README for detailed usage. ```bash sudo python tools/collectd-agent/pmt.py -s file://$(pwd)/xml/pmt.xml -i 10 ``` -------------------------------- ### PMT Agent Command Line Arguments Source: https://github.com/intel/intel-pmt/blob/main/tools/collectd-agent/Readme.md This describes the command-line interface for the pmt.py script. Use these options to configure the agent's behavior, such as specifying the metadata source, collection interval, and output logging. ```bash usage: pmt.py [-h] -s URL [-i INTERVAL] [-r] [-a] [-w ALLOWLIST] [-o OUTPUT_LOG_FILE] PMT agent, reporting telemetry to stdout. options: -h, --help show this help message and exit -s URL Path to PMT repository XML metadata (pmt.xml). URL or local file path. -i INTERVAL Interval between reads (in seconds). -r Read metrics and exit. -a Append sampleID to sample identifier. -w ALLOWLIST Path to file containing allowed metrics in form of list of regular expressions. Split by new line. -o OUTPUT_LOG_FILE Output log file. If file is not defined, logging is redirected to stdout. ``` -------------------------------- ### Run Schema Generator with Batch Configuration Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md Executes the schema-generator tool using a batch configuration file. ```bash # example input schema-generator -c examples/schema-generator-example.yaml ``` -------------------------------- ### Run Custom OpenTelemetry Collector Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Run the compiled OpenTelemetry Collector with PMT support using a specified configuration file. Navigate to the build directory first. ```bash cd build otelcol-pmt --config ../config-example-pmt-redfish.yaml ``` -------------------------------- ### Run Python Agent in Read-Once Mode Source: https://github.com/intel/intel-pmt/blob/main/docs/use-cases.md Use this command to run the Python agent in read-once mode for quick telemetry retrieval. Ensure the repository root and XML path are correctly specified. ```bash sudo python tools/collectd-agent/pmt.py -s file:///path_to_repo_root/xml/pmt.xml -r ``` -------------------------------- ### Build Custom OpenTelemetry Collector Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Build the custom OpenTelemetry Collector using OCB. Ensure the OCB executable is in your PATH or provide the full path. Adjust build-config.yaml for specific needs. ```bash cd tools/otel /path_to_ocb/ocb_exec --config build-config.yaml ``` -------------------------------- ### Stream Metrics with OpenTelemetry Collector (Local) Source: https://github.com/intel/intel-pmt/blob/main/docs/use-cases.md Configure and run the OpenTelemetry collector with a Prometheus exporter for dashboard integration. This command uses a local configuration file. ```bash ./otelcol-pmt --config tools/otel/configs/config-example-pmt-local.yaml ``` -------------------------------- ### Verify Metrics with cURL Source: https://github.com/intel/intel-pmt/blob/main/docs/getting-started.md Use cURL to fetch and display the metrics exposed by the OpenTelemetry Collector. This command shows the first few lines of the metrics output. ```bash curl http://localhost:8889/metrics | head ``` -------------------------------- ### Verify Container Metrics with cURL Source: https://github.com/intel/intel-pmt/blob/main/tools/docker/Readme.md Fetches metrics from the running 'pmt-container' to verify data collection. Assumes the container is accessible on localhost:9100. ```bash curl http://localhost:9100/metrics ``` -------------------------------- ### Batch Inventory Conversion Configuration Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md YAML configuration format for running the schema-generator in batch mode, processing multiple conversion tasks. ```yaml # (...) - avroSchema: "path/to/schema.avsc" telemetryInterfaceXml: "path/to/telemetry_interface.xml" sensorTypeYaml: "path/to/sensorTypes.yaml" output: "path/to/output.avro" version: "inventory_converter_version" - avroSchema: "path/to/schema.avsc" telemetryInterfaceXml: "path/to/telemetry_interface.xml" sensorTypeYaml: "path/to/sensorTypes.yaml" output: "path/to/output.avro" version: "inventory_converter_version" # (...) ``` -------------------------------- ### Stream Metrics with OpenTelemetry Collector (Remote) Source: https://github.com/intel/intel-pmt/blob/main/docs/use-cases.md Utilize the OpenTelemetry collector with a remote configuration for metrics streaming. This command is suitable for scenarios requiring remote management of collector settings. ```bash ./otelcol-pmt --config tools/otel/configs/config-example-pmt-redfish.yaml ``` -------------------------------- ### YAML Metadata Format (Version 1) Source: https://github.com/intel/intel-pmt/blob/main/tools/inventory-converter/README.md Defines the structure for version 1 YAML metadata files, specifying data sources for Kafka streams and Redfish sensors. ```yaml # (...) 386: # Identifies sampleID attribute from $(name)_aggregator_interface.xml type: Count # Maps to one of available Sensor types kafkaStream: - StreamingWatcher # Configures whether metric should be published using push model redfishSensor: - Aggregator # Configures whether metric should be published using Redfish sensor 389: type: Count kafkaStream: # Empty list means that this metric won't be published using Kafka stream redfishSensor: # This metric won't be published using Redfish sensor 474: type: Count kafkaStream: # Metric will be published using Kafka Stream and - ThresholdWatcher # data source of this metric will be Threshold Watcher redfishSensor: # Metric will be published using Redfish Sensor and - StreamingWatcher # data source of this metric will be Streaming Watcher 475: type: Count kafkaStream: - StreamingWatcher # Data source of this metric will - ThresholdWatcher # be Threshold Watcher redfishSensor: - StreamingWatcher # Data source of this metric will - ThresholdWatcher # be Threshold Watcher - Aggregator # (...) ``` -------------------------------- ### Run Intel PMT Docker Container Source: https://github.com/intel/intel-pmt/blob/main/tools/docker/Readme.md Runs the 'pmt' Docker container in detached mode, exposing port 9100 and mounting the host's /sys directory. This is necessary for telemetry data collection. ```bash docker run -d -h container-hostname -p 9100:9100 -v /sys:/hostfs/sys --name pmt-container pmt ``` -------------------------------- ### Access Prometheus Metrics Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Access the exported metrics via the Prometheus exporter endpoint. This allows you to view the collected telemetry data in Prometheus format. ```bash curl http://localhost:8889/metrics ``` -------------------------------- ### Configure TLS Skip Verify for Redfish Source: https://github.com/intel/intel-pmt/blob/main/tools/otel/Readme.md Configure the OpenTelemetry Collector to skip TLS certificate verification when connecting to Redfish endpoints. This is useful for environments with self-signed certificates. ```yaml endpoint: ... headers: Authorization: ... tls: insecure_skip_verify: true ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.