1 { config, lib, pkgs, options, ... }:
4 cfg = config.services.prometheus.exporters.unifi;
16 unifiAddress = mkOption {
18 example = "https://10.0.0.1:8443";
20 URL of the UniFi Controller API.
24 unifiInsecure = mkOption {
28 If enabled skip the verification of the TLS certificate of the UniFi Controller API.
33 unifiUsername = mkOption {
35 example = "ReadOnlyUser";
37 username for authentication against UniFi Controller API.
41 unifiPassword = mkOption {
44 Password for authentication against UniFi Controller API.
48 unifiTimeout = mkOption {
53 Timeout including unit for UniFi Controller API requests.
60 ${pkgs.prometheus-unifi-exporter}/bin/unifi_exporter \
61 -telemetry.addr ${cfg.listenAddress}:${toString cfg.port} \
62 -unifi.addr ${cfg.unifiAddress} \
63 -unifi.username ${escapeShellArg cfg.unifiUsername} \
64 -unifi.password ${escapeShellArg cfg.unifiPassword} \
65 -unifi.timeout ${cfg.unifiTimeout} \
66 ${optionalString cfg.unifiInsecure "-unifi.insecure" } \
67 ${concatStringsSep " \\\n " cfg.extraFlags}