### Unbound Control Stats Example Source: https://github.com/letsencrypt/unbound_exporter/blob/main/contrib/README.md Example output from the 'unbound-control stats_noreset' command, showing various operational metrics for the Unbound DNS resolver. This helps verify communication and monitor performance. ```shell $ unbound-control stats_noreset thread0.num.queries=35 thread0.num.queries_ip_ratelimited=0 thread0.num.cachehits=25 thread0.num.cachemiss=10 thread0.num.prefetch=0 thread0.num.expired=0 ... ``` -------------------------------- ### Install unbound_exporter Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Installs the unbound_exporter binary using Go's install command. The binary is placed in `$GOBIN` or `$HOME/go/bin` if `$GOBIN` is unset. ```Shell go install github.com/letsencrypt/unbound_exporter@latest ``` -------------------------------- ### Unbound Configuration Source: https://github.com/letsencrypt/unbound_exporter/blob/main/contrib/README.md Configuration stanza for /etc/unbound/unbound.conf to enable remote control and specify the paths for the generated server and control key/certificate files. ```unbound.conf remote-control: control-enable: yes control-use-cert: yes server-key-file: "/etc/unbound/unbound_server_ec.key" server-cert-file: "/etc/unbound/unbound_server_ec.pem" control-key-file: "/etc/unbound/unbound_control_ec.key" control-cert-file: "/etc/unbound/unbound_control_ec.pem" ``` -------------------------------- ### Unbound Remote Control TLS Setup Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Guides on configuring Unbound's remote control interface with TLS certificates for secure communication between Unbound and the exporter, especially when running on separate hosts. ```APIDOC Unbound Remote Control TLS Configuration: Reference: https://unbound.docs.nlnetlabs.net/en/latest/getting-started/configuration.html#set-up-remote-control Description: To enable secure communication via TLS, Unbound's control-interface needs to be configured with a TLS certificate from a private CA. The unbound_exporter must then be provided with the CA certificate, its own client certificate, and its private key using specific flags (`-unbound.ca`, `-unbound.cert`, `-unbound.key`) to establish a trusted connection. This setup is more complex but necessary for remote or secure deployments. ``` -------------------------------- ### Generate Unbound Keypair Source: https://github.com/letsencrypt/unbound_exporter/blob/main/contrib/README.md Executes the unbound-control-setup script to generate a new keypair. This script is designed to produce keypairs that satisfy newer versions of Golang, addressing potential CommonName deprecation issues. ```bash $ bash unbound-control-setup.sh ``` -------------------------------- ### Run unbound_exporter via Unix Socket Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Starts the unbound_exporter, connecting to the Unbound instance via its Unix socket. Metrics are exposed on port 9167. ```Shell unbound_exporter -unbound.ca "" -unbound.cert "" -unbound.host "unix:///run/unbound.ctl" ``` -------------------------------- ### Update Go Dependencies Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Updates project dependencies to their latest versions and tidies the go.mod file. ```Shell go get -u go mod tidy ``` -------------------------------- ### Unbound Configuration for Unix Socket Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Enables the remote control interface for Unbound via a Unix socket, allowing the exporter to connect. ```APIDOC unbound.conf Configuration: remote-control: control-enable: yes control-interface: /run/unbound.ctl Description: Enables the remote control interface for Unbound. The `control-interface` specifies the path to the Unix socket used for communication. This is a prerequisite for connecting the unbound_exporter via a Unix socket. ``` -------------------------------- ### Unbound Configuration for Extended Statistics Source: https://github.com/letsencrypt/unbound_exporter/blob/main/README.md Enables extended statistics collection in Unbound, providing more detailed metrics for the exporter. ```APIDOC unbound.conf Configuration: server: extended-statistics: yes Description: Enables the collection of extended statistics within Unbound. When enabled, Unbound provides more granular metrics, such as query types, which can be valuable for detailed monitoring by the unbound_exporter. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.