The nut_exporter can be configured using several command-line flags. Many of these flags can also be set via environment variables.
Connection Settings
--nut.server: Hostname or IP address of the NUT server. (Env: $NUT_EXPORTER_SERVER)--nut.serverport: Port on the NUT server. (Env: $NUT_EXPORTER_SERVERPORT)--nut.username: Username for NUT authentication. (Env: $NUT_EXPORTER_USERNAME). Note: The password must be provided via the $NUT_EXPORTER_PASSWORD environment variable.
Metric Customization
--nut.vars_enable: A comma-separated list of NUT variable names to monitor. (Env: $NUT_EXPORTER_VARIABLES)--nut.disable_device_info: Flag to disable the device_info meta metric. (Env: $NUT_EXPORTER_DISABLE_DEVICE_INFO)--nut.on_regex: Regex to determine if a string value should be coerced to 1. (Env: $NUT_EXPORTER_ON_REGEX)--nut.off_regex: Regex to determine if a string value should be coerced to 0. (Env: $NUT_EXPORTER_OFF_REGEX)--nut.statuses: Comma-separated list of status labels to always include. If NUT doesn't set a flag, the exporter forces the corresponding network_ups_tools_ups_status{flag="NAME"} to 0. (Env: $NUT_EXPORTER_STATUSES)--metrics.namespace: The Prometheus metrics namespace. (Env: $NUT_EXPORTER_METRICS_NAMESPACE)
Web and Logging
--web.listen-address: Address to expose metrics (e.g., :9199). Repeatable for multiple addresses.--web.telemetry-path: Path for UPS metrics (default: /ups_metrics). (Env: $NUT_EXPORTER_WEB_TELEMETRY_PATH)--web.exporter-telemetry-path: Path for exporter process metrics (default: /metrics). (Env: $NUT_EXPORTER_WEB_EXPORTER_TELEMETRY_PATH)--log.level: Minimum log level (error, warn, info, debug). (Env: $NUT_EXPORTER_LOG_LEVEL)--log.json: Format log lines as JSON. (Env: $NUT_EXPORTER_LOG_JSON)--printMetrics: Print metrics to stdout and exit. (Env: $NUT_EXPORTER_PRINT_METRICS)
usage: nut_exporter [<flags>]
Flags:
-h, --[no-]help Show context-sensitive help
--nut.server="127.0.0.1" Hostname or IP address of the server to connect to. ($NUT_EXPORTER_SERVER)
--nut.serverport=3493 Port on the NUT server to connect to. ($NUT_EXPORTER_SERVERPORT)
--nut.username=NUT.USERNAME If set, will authenticate with this username to the server. Password must be set in NUT_EXPORTER_PASSWORD environment variable. ($NUT_EXPORTER_USERNAME)
--[no-]nut.disable_device_info A flag to disable the generation of the device_info meta metric. ($NUT_EXPORTER_DISABLE_DEVICE_INFO)
--nut.vars_enable="battery.charge,battery.voltage,battery.voltage.nominal,input.voltage,input.voltage.nominal,ups.load,ups.status" A comma-separated list of variable names to monitor. ($NUT_EXPORTER_VARIABLES)
--nut.on_regex="^(enable|enabled|on|true|active|activated)$" Regex to determine if the var's value should be coaxed to 1 if it is a string. ($NUT_EXPORTER_ON_REGEX)
--nut.off_regex="^(disable|disabled|off|false|inactive|deactivated)$" Regex to determine if the var's value should be coaxed to 0 if it is a string. ($NUT_EXPORTER_OFF_REGEX)
--nut.statuses="OL,OB,LB,HB,RB,CHRG,DISCHRG,BYPASS,CAL,OFF,OVER,TRIM,BOOST,FSD,SD" A comma-separated list of statuses labels that will always be set by the exporter. ($NUT_EXPORTER_STATUSES)
--metrics.namespace="network_ups_tools" Metrics Namespace ($NUT_EXPORTER_METRICS_NAMESPACE)
--[no-]web.systemd-socket Use systemd socket activation listeners (Linux only).
--web.listen-address=:9199 ... Addresses on which to expose metrics. Repeatable.
--web.config.file="" Path to configuration file for TLS/auth.
--web.telemetry-path="/ups_metrics" Path under which to expose the UPS Prometheus metrics ($NUT_EXPORTER_WEB_TELEMETRY_PATH)
--web.exporter-telemetry-path="/metrics" Path under which to expose process metrics ($NUT_EXPORTER_WEB_EXPORTER_TELEMETRY_PATH)
--[no-]printMetrics Print the metrics this exporter exposes and exits. ($NUT_EXPORTER_PRINT_METRICS)
--log.level="info" Minimum log level. (error, warn, info, debug) ($NUT_EXPORTER_LOG_LEVEL)
--[no-]log.json Format log lines as JSON. ($NUT_EXPORTER_LOG_JSON)
--[no-]version Show application version.