Collect Proxmox VE guests, backup jobs and vzdump runs as a read-only linux.proxmox scope
Rust development slice / linux (push) Failing after 12s
Rust development slice / linux (push) Failing after 12s
The Linux agent queries the local PVE API with a PVEAuditor token from the systemd credential rmm-proxmox-token and the pinned cluster CA. Guests carry MAC addresses and SMBIOS UUIDs for hypervisor mapping; jobs carry covered guests and the scheduler's last expected run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ mod certificate_rotation;
|
||||
mod helper_sync;
|
||||
mod https_channel;
|
||||
mod jobs;
|
||||
mod proxmox_api;
|
||||
mod reconcile;
|
||||
#[cfg(test)]
|
||||
mod runtime_tests;
|
||||
@@ -524,14 +525,21 @@ impl<C: reconcile::SyncClock> Agent<C> {
|
||||
let extended = env::var("RMM_EXTENDED_INVENTORY").unwrap_or_else(|_| "1".into()) == "1";
|
||||
let binding = self.binding.clone();
|
||||
let catalog = self.catalog.cached(Utc::now());
|
||||
let runtime = tokio::runtime::Handle::current();
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let collected_at = Utc::now();
|
||||
let result = rmm_agent_linux::wire::snapshot(extended).and_then(|mut inventory| {
|
||||
if extended {
|
||||
inventory["observations"]
|
||||
let proxmox = runtime.block_on(proxmox_api::observation(
|
||||
rmm_agent_linux::inventory::proxmox_ve(),
|
||||
));
|
||||
let scopes = inventory["observations"]
|
||||
.as_array_mut()
|
||||
.context("INVENTORY_OBSERVATIONS")?
|
||||
.push(apt::planning_observation(binding.as_ref()));
|
||||
.context("INVENTORY_OBSERVATIONS")?;
|
||||
scopes.push(apt::planning_observation(binding.as_ref()));
|
||||
if let Some(observation) = proxmox {
|
||||
scopes.push(proxmox_api::wire(&observation)?);
|
||||
}
|
||||
inventory["collection_completed_at"] = serde_json::json!(Utc::now());
|
||||
}
|
||||
if let Some(report) = catalog {
|
||||
|
||||
Reference in New Issue
Block a user