Compare commits
2 Commits
bfeb43f38a
...
75494e2a71
Author | SHA1 | Date | |
---|---|---|---|
75494e2a71 | |||
8e6e291f6a |
@@ -68,7 +68,7 @@ pub async fn register_with_server(
|
||||
// Try to register (will retry on failure)
|
||||
loop {
|
||||
println!("Attempting to register with server...");
|
||||
let url = format!("{}/monitoring/register-agent-by-id", base_url);
|
||||
let url = format!("{}/monitoring/hardware-info", base_url);
|
||||
match client.post(&url).json(®istration).send().await {
|
||||
Ok(resp) if resp.status().is_success() => {
|
||||
println!("✅ Successfully registered with server.");
|
||||
@@ -108,7 +108,7 @@ async fn get_server_id_by_ip(
|
||||
.danger_accept_invalid_certs(true)
|
||||
.build()?;
|
||||
|
||||
let url = format!("{}/monitoring/server-id-by-ip?ipAddress={}", base_url, ip);
|
||||
let url = format!("{}/monitoring/register?ipAddress={}", base_url, ip);
|
||||
|
||||
loop {
|
||||
println!("Attempting to fetch server ID for IP {}...", ip);
|
||||
|
@@ -90,7 +90,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
|
||||
// Registration with backend server
|
||||
let (server_id, ip) = match api::register_with_server(&server_url).await {
|
||||
Ok((id, ip)) => (id, ip),
|
||||
Ok((id, ip)) => {
|
||||
println!("Registered with server. ID: {}, IP: {}", id, ip);
|
||||
(id, ip)
|
||||
},
|
||||
Err(e) => {
|
||||
eprintln!("Fehler bei der Registrierung am Server: {e}");
|
||||
return Err(e);
|
||||
|
Reference in New Issue
Block a user