From 14241d19a08e2dce08529a4a26df5895cdb87475 Mon Sep 17 00:00:00 2001 From: KeyserSosa Date: Mon, 26 Jan 2009 16:59:29 -0800 Subject: [PATCH] service monitor fix -- prevent displaying red background for db status and bug in is_db_machine lookup --- r2/r2/templates/appservicemonitor.html | 2 +- r2/supervise_watcher.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/r2/r2/templates/appservicemonitor.html b/r2/r2/templates/appservicemonitor.html index cc5dd52c0..ac2bddc26 100644 --- a/r2/r2/templates/appservicemonitor.html +++ b/r2/r2/templates/appservicemonitor.html @@ -44,7 +44,7 @@ <% host_id = host.host.replace('.', '-') load = host.load() - load_level = min(max(int(load+0.5), 0),5) + load_level = min(max(int(load+0.4), 0),4) %> diff --git a/r2/supervise_watcher.py b/r2/supervise_watcher.py index 28d520889..7aa7e8400 100644 --- a/r2/supervise_watcher.py +++ b/r2/supervise_watcher.py @@ -40,7 +40,7 @@ def is_db_machine(host): for ip in ips: name = socket.gethostbyaddr(ip)[0] if (name == host or ("." in host and name.endswith("." + host)) or - name.endswith(host + ".")): + name.startswith(host + ".")): return True return False