Accept separate OPNsense inventory and show VPN and PF observations in device details
Rust development slice / linux (push) Failing after 13s
Rust development slice / linux (push) Failing after 13s
This commit is contained in:
@@ -160,7 +160,7 @@ pub async fn ingest(
|
||||
ensure!(
|
||||
matches!(
|
||||
s.scope.as_str(),
|
||||
"linux.base" | "windows.base" | "agent.update"
|
||||
"linux.base" | "windows.base" | "opnsense.base" | "agent.update"
|
||||
) && s.schema_version == 1
|
||||
&& s.chunk_count == 1
|
||||
&& s.chunk_index == 0
|
||||
|
||||
@@ -34,7 +34,7 @@ SELECT c.*,o.observed_at,o.received_at,o.data,o.source_id FROM classified c
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT observed_at,received_at,data,source_id FROM observations
|
||||
WHERE tenant_id=c.tenant_id AND agent_id=c.agent_id AND received_at<=$2
|
||||
AND source_id IN ('linux.base','windows.base')
|
||||
AND source_id IN ('linux.base','windows.base','opnsense.base')
|
||||
ORDER BY observed_at DESC,received_at DESC,sequence DESC LIMIT 1
|
||||
) o ON true
|
||||
WHERE ($6::text IS NULL OR (c.lifecycle='current')=($6='current'))
|
||||
|
||||
@@ -517,7 +517,8 @@ fn project(row: &PgRow, now: DateTime<Utc>, full: bool, hosts: &HashMap<Uuid, Ho
|
||||
let ram_total = usage["ram_total_bytes"]
|
||||
.as_u64()
|
||||
.or_else(|| linux_memory["total_bytes"].as_u64())
|
||||
.or_else(|| windows["memory_total_bytes"].as_u64());
|
||||
.or_else(|| windows["memory_total_bytes"].as_u64())
|
||||
.or_else(|| data["memory_total_bytes"].as_u64());
|
||||
let device_type = inventory_device_type(&data);
|
||||
let last = row.get::<Option<DateTime<Utc>>, _>("last_contact_at");
|
||||
let revoked = row.get::<Option<DateTime<Utc>>, _>("revoked_at");
|
||||
@@ -536,8 +537,8 @@ fn project(row: &PgRow, now: DateTime<Utc>, full: bool, hosts: &HashMap<Uuid, Ho
|
||||
"hostname":data["hostname"].as_str(),"purpose":row.get::<Option<String>,_>("purpose"),
|
||||
"device_type":device_type,"os":os_label(&data),
|
||||
"disk_free_bytes":data["root_available_bytes"].as_u64(),"disk_total_bytes":data["root_total_bytes"].as_u64(),
|
||||
"cpu_model":cpu["model"].as_str().or_else(||windows["cpu_model"].as_str()),
|
||||
"cpu_logical_count":cpu["logical_processors"].as_u64().or_else(||windows["logical_processors_visible"].as_u64()),
|
||||
"cpu_model":cpu["model"].as_str().or_else(||windows["cpu_model"].as_str()).or_else(||data["cpu_model"].as_str()),
|
||||
"cpu_logical_count":cpu["logical_processors"].as_u64().or_else(||windows["logical_processors_visible"].as_u64()).or_else(||data["logical_processors"].as_u64()),
|
||||
"cpu_usage_percent":cpu_usage,
|
||||
"cpu_usage_observed_at":cpu_observed_at,
|
||||
"ram_total_bytes":ram_total,
|
||||
|
||||
Reference in New Issue
Block a user