feat(agent): service systemd DynamicUser + documentation déploiement
- Ajoute deploy/nanometrics-agent.service avec DynamicUser, ProtectSystem, PrivateTmp, NoNewPrivileges et RestrictAddressFamilies - Ajoute deploy/README.md avec procédure d'installation/désinstallation - Corrige 3 avertissements clippy : iter_kv_map (network.rs) et collapsible_match (mqtt.rs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
960fd02fd7
commit
12203f453f
@@ -1,8 +1,8 @@
|
||||
use sysinfo::Networks;
|
||||
|
||||
pub fn get(networks: &Networks) -> (u64, u64) {
|
||||
let rx: u64 = networks.iter().map(|(_, n)| n.total_received()).sum();
|
||||
let tx: u64 = networks.iter().map(|(_, n)| n.total_transmitted()).sum();
|
||||
let rx: u64 = networks.values().map(|n| n.total_received()).sum();
|
||||
let tx: u64 = networks.values().map(|n| n.total_transmitted()).sum();
|
||||
(rx, tx)
|
||||
}
|
||||
|
||||
|
||||
@@ -57,12 +57,10 @@ pub fn start(
|
||||
QoS::AtLeastOnce,
|
||||
);
|
||||
}
|
||||
Ok(Event::Incoming(Packet::Publish(p))) => {
|
||||
if p.topic == config_topic_clone {
|
||||
let _ = incoming_tx.send(MqttIncoming::ConfigUpdate(
|
||||
p.payload.to_vec(),
|
||||
));
|
||||
}
|
||||
Ok(Event::Incoming(Packet::Publish(p))) if p.topic == config_topic_clone => {
|
||||
let _ = incoming_tx.send(MqttIncoming::ConfigUpdate(
|
||||
p.payload.to_vec(),
|
||||
));
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("[mqtt] erreur: {}", e);
|
||||
|
||||
Reference in New Issue
Block a user