feat: accept native Windows passive client and tenant-safe inventory migration
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//! Development-only read-only receipt inspection. No network, grants or effects.
|
||||
#[cfg(windows)]
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let root = std::path::Path::new(r"C:\ProgramData\RustDiscovery\state");
|
||||
rmm_agent_windows::native::private_path(root, true)?;
|
||||
let path = root.join("telemetry.sqlite");
|
||||
rmm_agent_windows::native::private_path(&path, false)?;
|
||||
let db =
|
||||
rusqlite::Connection::open_with_flags(path, rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY)?;
|
||||
let count: u64 = db.query_row("SELECT count(*) FROM events", [], |r| r.get(0))?;
|
||||
let sequence: u64 =
|
||||
db.query_row("SELECT value FROM metadata WHERE key='sequence'", [], |r| {
|
||||
r.get(0)
|
||||
})?;
|
||||
let agent: String = db.query_row("SELECT agent FROM identity", [], |r| r.get(0))?;
|
||||
let integrity: String = db.query_row("PRAGMA integrity_check", [], |r| r.get(0))?;
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::json!({"agent_id":agent,"pending_inventory_events":count,"sequence":sequence,"integrity":integrity,"read_only":true})
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
fn main() {
|
||||
eprintln!("Windows-only receipt probe");
|
||||
std::process::exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user