### Install Scaphandre Helm Chart Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Install the Scaphandre Helm chart from the cloned source code. ```bash helm install scaphandre helm/scaphandre ``` -------------------------------- ### Run Scaphandre from PowerShell Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/installation-windows.md Example of how to run the Scaphandre executable from PowerShell after installing a development version of the driver. ```powershell & 'C:\Program Files (x86)\scaphandre\scaphandre.exe' stdout ``` -------------------------------- ### Install mdBook Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/contributing.md Installs mdBook, the static site generator used for the documentation website. This is a prerequisite for building the documentation locally. ```bash cargo install mdbook ``` -------------------------------- ### Install Grafana Helm Chart Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Install the Grafana Helm chart using a specified values file for configuration. ```bash helm install grafana grafana/grafana --values docs_src/tutorials/grafana-helm-values.yaml ``` -------------------------------- ### Prometheus Exporter Usage Example Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheus.md Example of how to use the Prometheus exporter with specific options. ```bash scaphandre prometheus --containers -a 127.0.0.1 -p 9090 -s /my-metrics ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/contributing.md Serves the current documentation content locally, allowing you to preview changes before committing. This command will start a local server to view the documentation website. ```bash mdbook serve ``` -------------------------------- ### Install Prometheus Helm Chart Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Install the Prometheus Helm chart, disabling persistent volumes for testing purposes. ```bash helm install prometheus prometheus-community/prometheus \ --set alertmanager.persistentVolume.enabled=false \ --set server.persistentVolume.enabled=false ``` -------------------------------- ### Install and Configure Scaphandre with Ansible Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md Execute the provided Ansible playbook to automate the installation and configuration of Scaphandre with the Prometheus-push exporter on RHEL. Ensure playbook parameters match your environment. ```bash ansible-playbook -i inventory -b -u myunprivilegeduser -K install-configure-prometheuspush-rhel.yml ``` -------------------------------- ### Add Prometheus and Kube-State-Metrics Helm Repositories Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Add necessary Helm repositories for Prometheus and kube-state-metrics before installing Prometheus. ```bash helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo add kube-state-metrics https://kubernetes.github.io/kube-state-metrics helm repo update ``` -------------------------------- ### Start Scaphandre Stack with Docker Compose Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/docker-compose.md Navigate to the docker-compose directory and run this command to start Scaphandre, Prometheus, and Grafana in detached mode. The container runs as privileged. ```bash cd docker-compose docker-compose up -d ``` -------------------------------- ### Install Scaphandre RPM Package Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md Use dnf to install the Scaphandre RPM package containing the Prometheus-push exporter. Replace URL with the actual package URL for RHEL 8 or 9. ```bash dnf install -y URL ``` -------------------------------- ### Get Powercap RAPL Sensor Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-powercap_rapl.md View available command-line arguments for the powercap_rapl sensor. ```bash scaphandre -s powercap_rapl -h ``` -------------------------------- ### Check Scaphandre Driver Status Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/installation-windows.md Command to check if the Scaphandre driver is installed and running on Windows. An error in driver setup often leads to 'Failed to open device' errors. ```powershell driverquery /v | findstr capha ``` -------------------------------- ### Add Grafana Helm Repository Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Add the Grafana Helm repository and update Helm repositories before installing Grafana. ```bash helm repo add grafana https://grafana.github.io/helm-charts helm repo update ``` -------------------------------- ### Restart and Enable Scaphandre Service Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md After configuration changes, restart the Scaphandre service to apply them and enable it to start automatically on system reboot. ```bash systemctl restart scaphandre-prometheuspush && systemctl enable scaphandre-prometheuspush ``` -------------------------------- ### Install extra kernel modules on Ubuntu Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/troubleshooting.md Install the 'linux-modules-extra' package to resolve 'Could'nt find XXX modules' errors, especially on Ubuntu 20.01 and 20.10. ```bash sudo apt install linux-modules-extra-$(uname -r) ``` -------------------------------- ### Check Cargo Version Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/compilation-linux.md Verify that your installed Cargo version meets the recommended minimum requirement. ```bash cargo --version cargo 1.48.0 (65cbdd2dc 2020-10-14) rustc --version rustc 1.48.0 (7eac88abb 2020-11-16) ``` -------------------------------- ### Clone Scaphandre Repository Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Clone the Scaphandre repository to access its Helm chart for installation. ```bash git clone https://github.com/hubblo-org/scaphandre cd scaphandre ``` -------------------------------- ### Enable Test Signing for Driver Installation Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/installation-windows.md Commands to enable Test Mode and disable integrity checks on Windows. This is required before installing development versions of the Scaphandre driver. ```powershell bcdedit.exe -set TESTSIGNING ON bcdedit.exe -set nointegritychecks on ``` -------------------------------- ### Riemann Query for Process Power Consumption Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-riemann.md An example Riemann Query Language (RQL) query to retrieve process power consumption metrics for specific services, such as Firefox and Scaphandre. ```riemann-query (service =~ "process_power_consumption_microwatts_%_firefox") or (service =~ "process_power_consumption_microwatts_%_scaphandre") ``` -------------------------------- ### Get Help for MSR RAPL Sensor Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-msr_rapl.md Display available command-line arguments for the msr_rapl sensor using the scaphandre -h flag. ```bash scaphandre -s msr_rapl -h ``` -------------------------------- ### Build error: linker 'cc' not found Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/troubleshooting.md Install build essentials to fix 'linker cc not found' errors during project compilation. This is common on Ubuntu/Debian systems. ```bash sudo apt install build-essential ``` -------------------------------- ### Run Scaphandre Prometheus-Push Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md Execute the Scaphandre Prometheus-push binary with the --help flag to view available CLI options and their references. ```bash /usr/bin/scaphandre-prometheuspush --help ``` -------------------------------- ### Build Scaphandre Binary on Windows Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/compilation-windows.md Use this command to build the Scaphandre binary on Windows after obtaining a working kernel driver. Include the `--release` flag for production builds. ```bash cargo build --no-default-features --features "prometheus json riemann" ``` -------------------------------- ### Run Qemu Exporter on Hypervisor Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Initiates the Scaphandre agent on the hypervisor using the Qemu exporter. This is the first step in enabling metric propagation. ```bash scaphandre qemu ``` -------------------------------- ### Apply Permissions with init.sh Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-powercap_rapl.md Run the init.sh script to grant the necessary read permissions to energy_uj files for the user running scaphandre. ```bash ../../init.sh ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/contributing.md Builds the documentation for the Scaphandre project. The output will be located in the 'scaphandre-documentation/docs' directory. ```bash cd scaphandre && mdbook build ``` -------------------------------- ### Run Scaphandre Binary (stdout) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md Execute the Scaphandre binary directly to output power consumption metrics to the terminal for 15 seconds. ```bash scaphandre stdout -t 15 ``` -------------------------------- ### Run init.sh script for permission issues Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/troubleshooting.md Execute this script to resolve 'permission denied' errors related to energy counter files on some Linux distributions. ```bash bash init.sh ``` -------------------------------- ### PrometheusPush Exporter Help Options Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheuspush.md Display the available command-line options for the PrometheusPush exporter. This helps in customizing host, port, suffix, scheme, step, and applying labels for Qemu or containers. ```bash scaphandre prometheus-push -h ``` -------------------------------- ### Launch Stdout Exporter with Raw Metrics Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Displays all available host metrics in a parseable list format. This is useful for identifying metrics to fetch later. ```bash scaphandre stdout --raw-metrics ``` -------------------------------- ### Launch Default JSON Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with default settings, measuring metrics for 10 seconds. ```bash scaphandre json ``` -------------------------------- ### Launch Stdout Exporter (Default) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Launches the stdout exporter with default settings, measuring and showing metrics for 10 seconds. ```bash scaphandre stdout ``` -------------------------------- ### Display JSON Exporter Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Displays the help information for the Scaphandre JSON exporter, listing available options and their descriptions. ```bash scaphandre json -h ``` -------------------------------- ### Sample Riemann Server Configuration Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-riemann.md A Clojure configuration for a Riemann server, demonstrating how to set up TCP, TLS/TCP, UDP, and WebSocket listeners, and configure event indexing and expiration. ```clojure ; -*- mode: clojure; -*- ; vim: filetype=clojure (logging/init {:file "riemann.log"}) ; Listen on the local interface over TCP (5555), UDP (5555), TLS/TCP (5554) and websockets ; (5556) (let [host "0.0.0.0"] (tcp-server {:host host}) (tcp-server {:host host :port 5554 :tls? true :key "/client.key.pkcs8" :cert "/client.pem" :ca-cert "/CA.pem"}) (udp-server {:host host}) (ws-server {:host host})) ; Expire old events from the index every 5 seconds. (periodically-expire 5) (let [index (index)] ; Inbound events will be passed to these streams: (streams (default :ttl 60 ; Index all events immediately. index ; Log expired events. (expired (fn [event] (info "expired" event)))))) ``` -------------------------------- ### Build Scaphandre for Release Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/compilation-linux.md Compile the Scaphandre project for production use, optimizing performance and size. The binary will be located in `target/release/`. ```bash cargo build --release ``` -------------------------------- ### Stdout Exporter Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Prints the help message for the stdout exporter, listing all available options and their descriptions. ```bash scaphandre stdout -h ``` -------------------------------- ### Stdout Exporter Usage Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Displays the detailed usage and options for the scaphandre stdout command. ```bash Usage: scaphandre stdout [OPTIONS] Options: -t, --timeout Maximum time spent measuring, in seconds. If negative, runs forever [default: 10] -s, --step Interval between two measurements, in seconds [default: 2] -p, --processes Maximum number of processes to display [default: 5] -r, --regex-filter Filter processes based on regular expressions (example: 'scaph\w\w.e') --containers Monitor and apply labels for processes running as containers -q, --qemu Apply labels to metrics of processes looking like a Qemu/KVM virtual machine --raw-metrics Display metrics with their names -h, --help Print help ``` -------------------------------- ### Launch PrometheusPush Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheuspush.md Launch the Prometheus exporter with the default configuration. Metrics will be sent to http://localhost:9091/metrics. ```bash scaphandre prometheus-push ``` -------------------------------- ### Create tmpfs Mountpoint on Hypervisor Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Creates a temporary filesystem mountpoint on the hypervisor for each virtual machine to store metrics. Ensure the size is adequate. ```bash mount -t tmpfs tmpfs_DOMAIN_NAME /var/lib/libvirt/scaphandre/DOMAIN_NAME -o size=5m ``` -------------------------------- ### Warp10 Exporter Command-Line Options Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-warp10.md Display available command-line options for the Warp10 exporter. These options control the host, port, scheme, write token, measurement step, and Qemu VM detection. ```bash Expose the metrics to a Warp10 host, through HTTP Usage: scaphandre warpten [OPTIONS] Options: -H, --host FQDN or IP address of the Warp10 instance [default: localhost] -p, --port TCP port of the Warp10 instance [default: 8080] -S, --scheme "http" or "https" [default: http] -t, --write-token Auth token to write data to Warp10. If not specified, you must set the env variable SCAPH_WARP10_WRITE_TOKEN -s, --step Interval between two measurements, in seconds [default: 2] -q, --qemu Apply labels to metrics of processes looking like a Qemu/KVM virtual machine -h, --help Print help ``` -------------------------------- ### Launch Prometheus Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheus.md Run the Prometheus exporter with the default powercap_rapl sensor. ```bash scaphandre prometheus ``` -------------------------------- ### Check Scaphandre Service Status and Logs Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md Use systemctl status to check the Scaphandre service and view logs for any configuration or connection issues with the Push Gateway. ```bash systemctl status scaphandre-prometheuspush ``` -------------------------------- ### Launch Warp10 Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-warp10.md Launch the Warp10 exporter with default settings. Ensure the SCAPH_WARP10_WRITE_TOKEN environment variable is set. ```bash scaphandre warp10 ``` -------------------------------- ### Create Tmpfs Mount Point Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-qemu.md Create a tmpfs mount point to isolate metrics for a specific virtual machine. Replace DOMAIN_NAME with the actual libvirt domain name. ```bash mount -t tmpfs tmpfs_DOMAIN_NAME /var/lib/libvirt/scaphandre/DOMAIN_NAME -o size=10m ``` -------------------------------- ### Run Powercap RAPL Sensor in VM Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-powercap_rapl.md Execute the powercap_rapl sensor within a virtual machine. Ensure the --vm flag is enabled. ```bash scaphandre --vm -s powercap_rapl EXPORTER ``` -------------------------------- ### Run Scaphandre with Podman (Privileged) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md When running Scaphandre with Podman on SELinux-enabled systems, use the --privileged flag to overcome potential access denied errors to /proc files. Refer to issue #106 for detailed explanations. ```bash podman run --privileged ... ``` -------------------------------- ### Run Scaphandre with Docker (stdout) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md Execute Scaphandre using Docker to output power consumption metrics to the terminal for 15 seconds. This command mounts necessary host directories for Scaphandre to access powercap and proc information. ```bash docker run -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -ti hubblo/scaphandre stdout -t 15 ``` -------------------------------- ### Add Filesystem Configuration to VM Definition Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Integrates a virtiofs filesystem configuration into the virtual machine's definition using libvirt. This allows the VM to access the shared metrics directory. ```xml ``` -------------------------------- ### Configure Filesystem in VM XML Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-qemu.md Add this filesystem configuration to the XML configuration of the virtual machine domain to expose metrics. Ensure the source directory matches the tmpfs mount point. ```xml ``` -------------------------------- ### Prometheus Exporter Help Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheus.md Display help information for the Prometheus exporter to view available flags and options. ```bash scaphandre prometheus -h ``` -------------------------------- ### Set JSON Exporter Timeout, Step, and Nano Step Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with a 10-second timeout, a 0-second step, and a 100ms (100,000,000 nanoseconds) step duration using -t, -s, and -n options. ```bash scaphandre json -t 10 -s 0 -n 100000000 ``` -------------------------------- ### Output JSON Exporter to File Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with specified timeout, step, nano step, and directs the output to a file named 'report.json' using the -f option. ```bash scaphandre json -t 10 -s 0 -n 100000000 -f report.json ``` -------------------------------- ### Monitor Processes in Containers with JSON Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter, disables the header, enables container monitoring, and limits top consumers to 15, piping the output to jq for processing. ```bash scaphandre --no-header json --containers --max-top-consumers=15 | jq ``` -------------------------------- ### Clone Scaphandre Repository Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/compilation-linux.md Download the latest source code of Scaphandre from its GitHub repository. ```bash git clone https://github.com/hubblo-org/scaphandre.git cd scaphandre cargo build # binary path is target/debug/scaphandre ``` -------------------------------- ### Launch Stdout Exporter with Custom Step and Timeout Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Configures the stdout exporter to measure metrics for a specified duration with a custom interval between measurements. ```bash scaphandre stdout -t 60 -s 5 ``` -------------------------------- ### Create Grafana Dashboard ConfigMap Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Create a Kubernetes config map to store the Grafana dashboard JSON file. ```bash kubectl create configmap scaphandre-dashboard \ --from-file=scaphandre-dashboard.json=docs_src/tutorials/grafana-kubernetes-dashboard.json ``` -------------------------------- ### Set JSON Exporter Timeout and Step Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with a 60-second timeout and a 5-second measurement step using -t and -s options. ```bash scaphandre json -t 60 -s 5 ``` -------------------------------- ### Verify Prometheus Metrics Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md Send an HTTP request to the Scaphandre Prometheus exporter endpoint to verify that power consumption metrics are available. ```bash curl -s http://localhost:8080/metrics ``` -------------------------------- ### Port Forward to Prometheus UI Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Establish a port forwarding connection to access the Prometheus web UI locally. ```bash kubectl port-forward deploy/prometheus-server 9090:9090 ``` -------------------------------- ### Configure Shared Memory for virtiofs Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Adds a memory backing configuration to the domain section of the VM definition if a 'virtiofs' requires shared memory. This resolves potential 'unsupported configuration' errors. ```xml ``` -------------------------------- ### Scaphandre Riemann Exporter Options Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-riemann.md Display help and available options for the Riemann exporter. This includes settings for server address, port, dispatch interval, and TLS/mTLS configuration. ```bash scaphandre riemann -h ``` -------------------------------- ### Configure Scaphandre Prometheus-Push Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/install-prometheuspush-only-rhel.md Edit the Prometheus-push exporter configuration file to specify the Push Gateway server details and data sending interval. Ensure SCAPHANDRE_ARGS are correctly set. ```bash vi /etc/scaphandre/prometheuspush ``` ```bash SCAPHANDRE_ARGS="prometheus-push -H localhost -S http" ``` ```bash SCAPHANDRE_ARGS="prometheus-push -H myserver.mydomain -S https -p PORT -s 30" ``` -------------------------------- ### Launch Stdout Exporter with Custom Process Count Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Displays a specified number of top consuming processes. Note that this is disabled if a regex filter is also used. ```bash scaphandre stdout -p 20 ``` -------------------------------- ### Run Scaphandre with Docker (Prometheus) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md Deploy Scaphandre using Docker to expose power consumption metrics via an HTTP endpoint for Prometheus to scrape. The Prometheus exporter is configured to listen on port 8080. ```bash docker run -v /sys/class/powercap:/sys/class/powercap -v /proc:/proc -p 8080:8080 -ti hubblo/scaphandre prometheus ``` -------------------------------- ### Filter Processes by Name with JSON Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with container monitoring enabled, filtering processes by name using a regular expression. Requires the --containers flag. ```bash scaphandre --containers --process-regex "scaph\w\w.e" ``` -------------------------------- ### Load Kernel Module Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/getting_started.md Load the intel_rapl_common module or intel_rapl for older kernels if required by your system's kernel version. ```bash modprobe intel_rapl_common # or intel_rapl for kernels < 5 ``` -------------------------------- ### Port Forward to Grafana UI Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Establish a port forwarding connection to access the Grafana web UI locally. ```bash kubectl port-forward deploy/grafana 3000:3000 ``` -------------------------------- ### Mount Shared Filesystem Inside VM Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Mounts the shared filesystem within the virtual machine using the 9p protocol. This makes the metrics accessible inside the VM. ```bash mount -t 9p -o trans=virtio scaphandre /var/scaphandre ``` -------------------------------- ### Scaphandre Riemann Exporter Usage Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-riemann.md Launch the Riemann exporter with default settings. Use -h to display all available options. ```bash scaphandre riemann ``` -------------------------------- ### Create Scaphandre Windows Service Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/installation-windows.md Use this command to create a Windows service for Scaphandre, configuring it to run the prometheus-push exporter in the background. It targets a Prometheus Push Gateway server with specific settings for metrics reporting. ```powershell sc.exe create Scaphandre binPath="C:\Program Files (x86)\scaphandre\scaphandre.exe prometheus-push -H 198.51.100.5 -s 45 -S https -p 443 --no-tls-check" DisplayName=Scaphandre start=auto ``` -------------------------------- ### Check RAPL Availability on CPU (GNU/Linux) Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/compatibility.md Use this command on GNU/Linux to verify if RAPL (Running Average Power Limit) is supported on your CPU by checking for the 'pts' and 'pln' feature flags. ```bash egrep "(pts|pln)" /proc/cpuinfo ``` -------------------------------- ### Prometheus Exporter Help Output Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-prometheus.md The output of the Prometheus exporter's help command, detailing its usage, flags, and options. ```text scaphandre-prometheus Prometheus exporter exposes power consumption metrics on an http endpoint (/metrics is default) in prometheus accepted format USAGE: scaphandre prometheus [FLAGS] [OPTIONS] FLAGS: --containers Monitor and apply labels for processes running as containers -h, --help Prints help information -q, --qemu Instruct that scaphandre is running on an hypervisor -V, --version Prints version information OPTIONS: -a, --address
ipv6 or ipv4 address to expose the service to [default: ::] -p, --port TCP port number to expose the service [default: 8080] -s, --suffix url suffix to access metrics [default: metrics] ``` -------------------------------- ### Run Powercap RAPL Sensor Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-powercap_rapl.md Explicitly call the powercap_rapl sensor from the command line. Replace EXPORTER with the desired exporter name. ```bash scaphandre -s powercap_rapl EXPORTER ``` -------------------------------- ### Filter Containers by Name with JSON Exporter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter with container monitoring enabled, filtering containers by name using a regular expression. Requires the --containers flag. ```bash scaphandre --containers --container-regex "my_container_name" ``` -------------------------------- ### Launch Stdout Exporter with Custom Timeout Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Sets a custom timeout for the stdout exporter. A timeout of 0 runs indefinitely until interrupted. ```bash scaphandre stdout -t 60 ``` -------------------------------- ### Set Powercap RAPL Path in VM Mode Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-powercap_rapl.md Set the SCAPHANDRE_POWERCAP_PATH environment variable to specify a custom path for reading metrics when running in VM mode. ```bash export SCAPHANDRE_POWERCAP_PATH=/path/to/your/metrics ``` -------------------------------- ### Calculate Host Watts from Process Power Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/explanations/host_metrics.md This Prometheus query calculates the total host power consumption in Watts by summing the `scaph_process_power_consumption_microwatts` metric for a given hostname. ```Prometheus sum(scaph_process_power_consumption_microwatts{hostname="$hostname"}) / 1000000 ``` -------------------------------- ### Run Scaphandre within VM for Export Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/propagate-metrics-hypervisor-to-vm_qemu-kvm.md Executes Scaphandre inside the virtual machine to export metrics using a chosen exporter, such as Prometheus. This step makes the propagated metrics available for monitoring. ```bash scaphandre --vm prometheus ``` -------------------------------- ### Call MSR RAPL Sensor from Command Line Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/sensor-msr_rapl.md Explicitly invoke the msr_rapl sensor using the scaphandre command-line interface. Replace EXPORTER with your desired exporter name. ```bash scaphandre -s msr_rapl EXPORTER ``` -------------------------------- ### Stop Scaphandre Stack with Docker Compose Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/docker-compose.md Navigate to the docker-compose directory and run this command to stop and remove the containers, networks, and volumes created by Docker Compose. ```bash docker-compose down ``` -------------------------------- ### Launch Stdout Exporter with Regex Process Filter Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-stdout.md Filters the displayed processes using a regular expression. This option disables the process count limit (`-p`). ```bash scaphandre stdout -r 'scaphandre' ``` -------------------------------- ### Set JSON Exporter Timeout Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-json.md Launches the JSON exporter and sets the measurement timeout to 60 seconds using the -t option. ```bash scaphandre json -t 60 ``` -------------------------------- ### Grafana Query for Nginx Power Consumption Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/how-to_guides/get-process-level-power-in-grafana.md Use this Prometheus query within Grafana to filter and display the power consumption in Watts for Nginx processes on a specific host. Assumes Scaphandre's Prometheus exporter is running on port 8080. ```promql scaph_process_power_consumption_microwatts{cmdline=~".*nginx.*", instance="10.0.0.9:8080"} / 1000000 ``` -------------------------------- ### Delete Helm Releases Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Remove all created Kubernetes resources by deleting the respective Helm releases. ```bash helm delete grafana prometheus scaphandre ``` -------------------------------- ### Decode Grafana Admin Password Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/kubernetes.md Retrieve and decode the randomly generated admin password for the Grafana instance. ```bash kubectl get secret grafana -o jsonpath="{.data.admin-password}" | base64 --decode ``` -------------------------------- ### Delete Scaphandre Windows Service Source: https://github.com/hubblo-org/scaphandre/blob/main/docs_src/tutorials/installation-windows.md Command to remove the Scaphandre Windows service. This can also be done through the Services.msc application. ```powershell sc.exe delete Scaphandre ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.