This commit is contained in:
Graham McIntire 2026-01-20 11:33:37 -06:00
parent 71267870b0
commit 6cea690e6b
No known key found for this signature in database
4 changed files with 9 additions and 13 deletions

View file

@ -57,7 +57,8 @@ pub async fn start_health_server(port: u16) -> Result<()> {
let _ = socket.write_all(response.as_bytes()).await;
} else {
// 404 for other paths
let response = "HTTP/1.1 404 Not Found\r\nContent-Length: 9\r\n\r\nNot found";
let response =
"HTTP/1.1 404 Not Found\r\nContent-Length: 9\r\n\r\nNot found";
let _ = socket.write_all(response.as_bytes()).await;
}
}

View file

@ -172,9 +172,9 @@ fn parse_icmp_reply(packet: &[u8], expected_identifier: u16, expected_sequence:
Err(format!(
"Invalid ICMP reply packet (expected seq={}): {}",
expected_sequence,
packet_preview
).into())
expected_sequence, packet_preview
)
.into())
}
fn try_parse_icmp(packet: &[u8], _expected_identifier: u16, expected_sequence: u16) -> Result<()> {
@ -195,11 +195,9 @@ fn try_parse_icmp(packet: &[u8], _expected_identifier: u16, expected_sequence: u
} else {
Err(format!(
"ICMP packet mismatch (type={}, code={}, id={}, seq={})",
icmp_type,
icmp_code,
identifier,
sequence
).into())
icmp_type, icmp_code, identifier, sequence
)
.into())
}
}

View file

@ -22,6 +22,5 @@ mod tests {
// Just verify it's a non-empty string
}
// Note: check_for_updates() just logs the version, no testing needed
}

View file

@ -324,9 +324,7 @@ impl AgentClient {
/// Execute an SNMP job and collect results.
async fn execute_job(job: AgentJob, result_tx: mpsc::UnboundedSender<SnmpResult>) -> Result<()> {
let snmp_device = job
.snmp_device
.ok_or("Job missing SNMP device info")?;
let snmp_device = job.snmp_device.ok_or("Job missing SNMP device info")?;
let mut oid_values: HashMap<String, String> = HashMap::new();
let snmp_client = SnmpClient::new();