include device id and ip in snmp error logs
This commit is contained in:
parent
cf08b0589b
commit
0548ca313d
1 changed files with 14 additions and 2 deletions
|
|
@ -381,7 +381,13 @@ async fn execute_job(job: AgentJob, result_tx: mpsc::UnboundedSender<SnmpResult>
|
|||
oid_values.insert(oid.clone(), value_to_string(value));
|
||||
}
|
||||
Err(e) => {
|
||||
crate::log_warn!("SNMP GET failed for OID {}: {}", oid, e);
|
||||
crate::log_warn!(
|
||||
"SNMP GET failed for device {} ({}), OID {}: {}",
|
||||
job.device_id,
|
||||
snmp_device.ip,
|
||||
oid,
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -405,7 +411,13 @@ async fn execute_job(job: AgentJob, result_tx: mpsc::UnboundedSender<SnmpResult>
|
|||
}
|
||||
}
|
||||
Err(e) => {
|
||||
crate::log_warn!("SNMP WALK failed for OID {}: {}", base_oid, e);
|
||||
crate::log_warn!(
|
||||
"SNMP WALK failed for device {} ({}), OID {}: {}",
|
||||
job.device_id,
|
||||
snmp_device.ip,
|
||||
base_oid,
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue