Fix SSH connection count and re-enable nginx site accessibility check

- Use full path /run/current-system/sw/bin/ss for SSH connection counting
- Re-enable nginx site accessibility checking with full curl path
- This should show SSH connection counts and verify which nginx sites are accessible
This commit is contained in:
Christoffer Martinsson 2025-10-13 16:23:21 +02:00
parent 5a215fc259
commit 2e67f17d6c

View File

@ -446,7 +446,7 @@ impl ServiceCollector {
async fn get_ssh_active_users(&self) -> Option<String> {
// Use ss to find established SSH connections on port 22
let output = Command::new("ss")
let output = Command::new("/run/current-system/sw/bin/ss")
.args(["-tn", "state", "established", "sport", "= :22"])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
@ -701,9 +701,10 @@ impl ServiceCollector {
// Check which sites are actually accessible
let mut accessible_sites = Vec::new();
for site in sites {
// Temporarily disable accessibility check - show all parsed sites
if self.check_site_accessibility(&site).await {
accessible_sites.push(site); // Remove checkmark - status will be shown via sub_service row status
}
}
// Limit to reasonable number
accessible_sites.truncate(15);
@ -766,7 +767,7 @@ impl ServiceCollector {
match tokio::time::timeout(
Duration::from_secs(5),
Command::new("curl")
Command::new("/run/current-system/sw/bin/curl")
.args(["-s", "-I", "--max-time", "3", &url])
.stdout(Stdio::piped())
.stderr(Stdio::piped())