feat: implementation for opnsense os-node_exporter #173

Open
wjro wants to merge 9 commits from feat/install_opnsense_node_exporter into master
62 changed files with 819 additions and 1678 deletions
Showing only changes of commit 9ba939bde1 - Show all commits

View File

@@ -25,7 +25,9 @@ struct OpnSenseTopology {
#[async_trait]
impl Topology for OpnSenseTopology {
async fn ensure_ready(&self) -> Result<PreparationOutcome, PreparationError> {
Ok(PreparationOutcome::Success{ details: "Success".to_string() })
Ok(PreparationOutcome::Success {
details: "Success".to_string(),
})
}
fn name(&self) -> &str {
"OpnsenseTopology"

View File

@@ -25,7 +25,10 @@ impl NodeExporter for OPNSenseFirewall {
})?;
}
config.node_exporter().enable(true).map_err(|e|ExecutorError::UnexpectedError(e.to_string()))?;
config
.node_exporter()
.enable(true)
.map_err(|e| ExecutorError::UnexpectedError(e.to_string()))?;
Ok(())
}
async fn commit_config(&self) -> Result<(), ExecutorError> {

View File

@@ -14,6 +14,7 @@ use opnsense_config_xml::OPNsense;
use russh::client;
use serde::Serialize;
use sha2::Digest;
use tokio::time::{sleep, Duration};
use super::{ConfigManager, OPNsenseShell};