Add PBS exporter and failure alerts - #17
Conversation
|
/oc plan what changes are required on pbs (mainly which permissions does the api key need) , how can I use 1 secret for two hosts as they seem to be autogenerated |
PBS-side requirementsOn each PBS server:
Equivalent commands: proxmox-backup-manager user create prometheus@pbs
proxmox-backup-manager acl update / Audit \
--auth-id prometheus@pbs
proxmox-backup-manager user generate-token \
prometheus@pbs exporter
proxmox-backup-manager acl update / Audit \
--auth-id 'prometheus@pbs!exporter'The exporter also needs network access from Using one secret for two PBS serversThe token ID can be identical on both servers: However, the token secret is generated and stored independently by each PBS server. Creating the same token name on two servers produces two different secrets. PBS does not provide a supported way to request the same token secret on both independent servers. Therefore, use:
Copying PBS token storage between servers to force a shared secret would be unsupported and would unnecessarily increase the impact of credential compromise. Required repository changes for two PBS hostsThe current implementation starts one exporter with one global credential pair: PBS_TOKEN_ID: "{{ pbs_exporter_api_token_id }}"
PBS_TOKEN_SECRET: "{{ pbs_exporter_api_token_secret }}"Meanwhile, NetBox discovery can return both PBS hosts. The second host will receive the first host’s credentials and fail authentication. Implementation plan
No PBS configuration needs to be managed by Ansible for this PR unless automatic user/token provisioning is specifically desired. |
|
/oc plan Is there a way for me to set the API secret somewhere in netbox so it can be inserted automatically? Or maybe even in 1password and requested at Ansible-playbook runtime. (Less preferred, same issue as below) As now I would have to rerun the ansible playbook after adding a new pbs host in netbox. |
Short answerNetBox can expose a custom field or config-context value to Ansible, but it is not an appropriate secret store. The value could also appear in API responses and Prometheus service-discovery labels. 1Password lookup at playbook runtime is feasible, but neither NetBox nor 1Password can update an already-running exporter. Each PBS requires its own generated token secret, and the current exporter container accepts only one credential pair. Some form of reconciliation must run whenever a PBS host is added. The safest approach is:
This removes the manual rerun, although Ansible still runs behind the scenes. Concrete implementation plan
If absolutely no reconciliation run is acceptable, the architecture would need to change—for example, deploying an exporter directly on every PBS host with locally stored credentials. The current central exporter model cannot dynamically acquire a newly generated per-host token from NetBox service discovery alone. |
|
/oc plan go with the initial idea of using a variable, this is easier and pbs instances are not changing that often |
Implementation plan
Adding or removing a PBS instance will require updating this variable and rerunning the monitoring playbook, which matches the selected low-change approach. |
|
/oc build make the requested changes |
|
Implemented multi-instance PBS exporter support, per-instance NetBox scrape routing, legacy exporter cleanup, secret-safe validation, and valid Prometheus alert identifiers. |
|
/oc plan rework so there is only 1 exporter but use a target file with an API secret per host. Spinning up an exporter per host is not the pattern we want to have. Also for alerts, use the naming convention as shown with other alerts |
Implementation plan
|
|
/oc build implement |
|
Implemented single-container PBS exporter configuration with per-target credential file, updated scrape routing, legacy exporter cleanup, and human-readable PBS alert names. |
Co-authored-by: 33Fraise33 <33Fraise33@users.noreply.github.com>
Co-authored-by: 33Fraise33 <33Fraise33@users.noreply.github.com>
Co-authored-by: 33Fraise33 <33Fraise33@users.noreply.github.com>
5d0f4a3 to
9a73c71
Compare
Implemented Natron Tech PBS exporter deployment, PBS NetBox SD scrape job, feature gating for
beokpdcovm01, and critical backup/verify/sync failure alerts. Credentials are required through inventory variables and kept out of task output.Closes #16
github run