Remove nginx site accessibility filtering to monitor all sites
- Remove check_site_accessibility function and filtering logic - Monitor ALL nginx sites from config regardless of current status - Site status determined by measure_site_latency, not accessibility filter - Fixes missing git.cmtec.se when backend is down (502 errors) - Sites with errors now show as failed instead of being filtered out
This commit is contained in:
@@ -986,21 +986,11 @@ impl ServiceCollector {
|
||||
}
|
||||
|
||||
|
||||
// Check which sites are actually accessible
|
||||
let mut accessible_sites = Vec::new();
|
||||
for site in 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);
|
||||
|
||||
if accessible_sites.is_empty() {
|
||||
// Return all sites from nginx config (monitor all, regardless of current status)
|
||||
if sites.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(accessible_sites)
|
||||
Some(sites)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1048,34 +1038,6 @@ impl ServiceCollector {
|
||||
}
|
||||
}
|
||||
|
||||
async fn check_site_accessibility(&self, hostname: &str) -> bool {
|
||||
// Create HTTP client with same timeout as site latency checks
|
||||
let client = match reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(2))
|
||||
.build()
|
||||
{
|
||||
Ok(client) => client,
|
||||
Err(_) => return false,
|
||||
};
|
||||
|
||||
// Try HTTPS first, then HTTP
|
||||
for scheme in ["https", "http"] {
|
||||
let url = format!("{}://{}", scheme, hostname);
|
||||
|
||||
match client.get(&url).send().await {
|
||||
Ok(response) => {
|
||||
let status = response.status().as_u16();
|
||||
// Check for successful HTTP status codes (same logic as before)
|
||||
if status == 200 || status == 301 || status == 302 || status == 403 {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Err(_) => continue,
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
async fn get_nginx_description(&self) -> Option<String> {
|
||||
// Get site count and active connections
|
||||
|
||||
Reference in New Issue
Block a user