### Run Marzban Metrics Exporter via CLI Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md This snippet demonstrates how to run the Marzban Metrics Exporter directly from the command line, providing essential configuration parameters such as the Marzban base URL, username, and password as arguments. ```bash /marzban-exporter --marzban-base-url= --marzban-username= --marzban-password= ``` -------------------------------- ### Marzban Metrics Exporter Configuration Options Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md This section details the available configuration options for the Marzban Metrics Exporter. Options can be set via environment variables or command-line arguments, with command-line arguments taking precedence. It lists variable names, command-line equivalents, requirements, default values, and descriptions for each setting. ```APIDOC Configuration Options: MARZBAN_BASE_URL: command_line_arg: --marzban-base-url required: No default_value: https:// description: URL of the Marzban management panel. MARZBAN_USERNAME: command_line_arg: --marzban-username required: Yes default_value: description: Username for the Marzban panel. MARZBAN_PASSWORD: command_line_arg: --marzban-password required: Yes default_value: description: Password for the Marzban panel. MARZBAN_SOCKET: command_line_arg: --marzban-socket required: No default_value: description: Path to Marzban Unix Domain Socket. METRICS_PORT: command_line_arg: --metrics-port required: No default_value: 9090 description: Port for the metrics server. METRICS_PROTECTED: command_line_arg: --metrics-protected required: No default_value: false description: Enable BasicAuth protection for metrics endpoint. METRICS_USERNAME: command_line_arg: --metrics-username required: No default_value: metricsUser description: Username for BasicAuth, effective if METRICS_PROTECTED is true. METRICS_PASSWORD: command_line_arg: --metrics-password required: No default_value: MetricsVeryHardPassword description: Password for BasicAuth, effective if METRICS_PROTECTED is true. UPDATE_INTERVAL: command_line_arg: --update-interval required: No default_value: 30 description: Interval (in seconds) for metrics update. TIMEZONE: command_line_arg: --timezone required: No default_value: UTC description: Timezone for correct time display. INACTIVITY_TIME: command_line_arg: --inactivity-time required: No default_value: 2 description: Time (in minutes) to determine user activity. ``` -------------------------------- ### Run Marzban Metrics Exporter with Docker Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md This snippet shows how to deploy the Marzban Metrics Exporter using a Docker container. It configures the Marzban panel URL, username, and password via environment variables and maps the exporter's metrics port to the host. ```bash docker run -d \ -e MARZBAN_BASE_URL= \ -e MARZBAN_USERNAME= \ -e MARZBAN_PASSWORD= \ -p 9090:9090 \ kutovoys/marzban-exporter ``` -------------------------------- ### Deploy Marzban Metrics Exporter with Docker Compose Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md This Docker Compose configuration defines a service for the Marzban Metrics Exporter, specifying the image, environment variables for Marzban panel credentials, and port mapping. It simplifies the deployment and management of the exporter alongside other services. ```yaml version: "3" services: marzban-exporter: image: kutovoys/marzban-exporter environment: - MARZBAN_BASE_URL= - MARZBAN_USERNAME= - MARZBAN_PASSWORD= ports: - "9090:9090" ``` -------------------------------- ### Marzban Metrics Exposed by Exporter Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md A comprehensive list of Prometheus metrics exposed by the Marzban Metrics Exporter, detailing various aspects of Marzban VPN service monitoring including node status, traffic, user activity, and panel system health. ```APIDOC marzban_nodes_status: Status of Marzban nodes (1 for connected, 0 otherwise). marzban_nodes_uplink: Uplink traffic of Marzban nodes. marzban_nodes_downlink: Downlink traffic of Marzban nodes. marzban_user_data_limit: Data limit of the user. marzban_user_used_traffic: Used traffic of the user. marzban_user_lifetime_used_traffic: Lifetime used traffic of the user. marzban_user_expiration_date: User's subscription expiration date marzban_user_online: Whether a user is online within the last 2 minutes. marzban_core_started: Indicates if the core is started (1) or not (0). marzban_panel_mem_total: Total memory. marzban_panel_mem_used: Used memory. marzban_panel_cpu_cores: Number of CPU cores. marzban_panel_cpu_usage: CPU usage percentage. marzban_panel_total_users: Total number of users. marzban_panel_users_active: Number of active users. marzban_all_incoming_bandwidth: Incoming bandwidth. marzban_all_outgoing_bandwidth: Outgoing bandwidth. marzban_panel_incoming_bandwidth_speed: Incoming bandwidth speed. marzban_panel_outgoing_bandwidth_speed: Outgoing bandwidth speed. ``` -------------------------------- ### Configure Prometheus to Scrape Marzban Exporter Metrics Source: https://github.com/kutovoys/marzban-exporter/blob/main/README.md This YAML snippet demonstrates how to add the Marzban Metrics Exporter as a scrape target in a Prometheus configuration file. It defines a job_name and static_configs with the target address and port for Prometheus to collect metrics from the exporter. ```yaml scrape_configs: - job_name: "marzban_exporter" static_configs: - targets: [":9090"] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.