Fix SMART data and site latency checking issues
- Add sudo to disk collector smartctl commands for proper SMART data access - Add reqwest dependency with blocking feature for HTTP site checks - Replace curl-based site latency with reqwest HTTP client implementation - Maintain 2-second connect timeout and 5-second total timeout - Fix disk health UNKNOWN status by enabling proper SMART permissions - Fix nginx site timeout issues by using proper HTTP client with redirect support
This commit is contained in:
@@ -176,7 +176,8 @@ impl DiskCollector {
|
||||
|
||||
/// Get SMART health for a specific physical device
|
||||
fn get_smart_health(&self, device: &str) -> (String, f32) {
|
||||
if let Ok(output) = Command::new("smartctl")
|
||||
if let Ok(output) = Command::new("sudo")
|
||||
.arg("smartctl")
|
||||
.arg("-H")
|
||||
.arg(device)
|
||||
.output()
|
||||
@@ -192,7 +193,8 @@ impl DiskCollector {
|
||||
};
|
||||
|
||||
// Try to get temperature
|
||||
let temperature = if let Ok(temp_output) = Command::new("smartctl")
|
||||
let temperature = if let Ok(temp_output) = Command::new("sudo")
|
||||
.arg("smartctl")
|
||||
.arg("-A")
|
||||
.arg(device)
|
||||
.output()
|
||||
|
||||
Reference in New Issue
Block a user