From be3192a14735c2e011e3267a8a487faab5d9cd44 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 28 Apr 2006 12:53:08 +0000 Subject: [PATCH] cope with name changes --- hbd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hbd b/hbd index 8e5910d..0e0cce2 100755 --- a/hbd +++ b/hbd @@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: hbd,v 1.10 2006/04/28 12:23:59 andreas Exp $ +# $Id: hbd,v 1.11 2006/04/28 12:53:08 andreas Exp $ # Wait for heartbeat messages and act on them (or their absence) # import time, os, string, sys, socket, atexit, select, SocketServer, getopt @@ -252,6 +252,13 @@ def fromaddr(name, addr, boot, interval): if not htab.has_key(addr): addhost(name, addr) host=hosts[htab[addr]] + if host.name != name: + log("%s changed name to %s" % (host.name, name)) + del hosts[host.name] + host.name=name + hosts[name]=host + htab[addr]=name + host.lastbeat=now if host.getstate() != Host.up and interval > 0: lasts=host.state