Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fefe30ec51 | |||
| fb40cce748 |
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.176"
|
version = "0.1.178"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -779,10 +779,10 @@ impl SystemdCollector {
|
|||||||
fn get_docker_containers(&self) -> Vec<(String, String)> {
|
fn get_docker_containers(&self) -> Vec<(String, String)> {
|
||||||
let mut containers = Vec::new();
|
let mut containers = Vec::new();
|
||||||
|
|
||||||
// Check if docker is available (use sudo for permissions)
|
// Check if docker is available (cm-agent user is in docker group)
|
||||||
// Use -a to show ALL containers (running and stopped)
|
// Use -a to show ALL containers (running and stopped)
|
||||||
let output = Command::new("sudo")
|
let output = Command::new("docker")
|
||||||
.args(&["docker", "ps", "-a", "--format", "{{.Names}},{{.Status}}"])
|
.args(&["ps", "-a", "--format", "{{.Names}},{{.Status}}"])
|
||||||
.output();
|
.output();
|
||||||
|
|
||||||
let output = match output {
|
let output = match output {
|
||||||
@@ -826,15 +826,16 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
info!("Collecting Docker images");
|
info!("Collecting Docker images");
|
||||||
|
|
||||||
// Check if docker is available (use sudo for permissions)
|
// Check if docker is available (cm-agent user is in docker group)
|
||||||
let output = Command::new("sudo")
|
let output = Command::new("docker")
|
||||||
.args(&["docker", "images", "--format", "{{.Repository}}:{{.Tag}},{{.Size}}"])
|
.args(&["images", "--format", "{{.Repository}}:{{.Tag}},{{.Size}}"])
|
||||||
.output();
|
.output();
|
||||||
|
|
||||||
let output = match output {
|
let output = match output {
|
||||||
Ok(out) if out.status.success() => out,
|
Ok(out) if out.status.success() => out,
|
||||||
Ok(out) => {
|
Ok(out) => {
|
||||||
info!("Docker images command failed with status: {}", out.status);
|
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||||
|
info!("Docker images command failed with status: {}, stderr: {}", out.status, stderr);
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.176"
|
version = "0.1.178"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.176"
|
version = "0.1.178"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user