From 6146e0a4dcc44ddab1b9d7511b696d73cbf4a963 Mon Sep 17 00:00:00 2001 From: andreas Date: Sat, 9 Jun 2012 15:21:07 +0000 Subject: [PATCH] highlight "bad" states --- hbd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hbd b/hbd index d073d2a..ea0d4b9 100755 --- a/hbd +++ b/hbd @@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: hbd,v 1.29 2012/03/29 00:16:11 andreas Exp $ +# $Id: hbd,v 1.30 2012/06/09 15:21:07 andreas Exp $ # Wait for heartbeat messages and act on them (or their absence) # import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle @@ -75,9 +75,13 @@ class Host: return self.state def dispstate(self): + if self.state in ["down","overdue"]: + state="%s" % self.state + else: + state="%s" % self.state if self.doesack != "": - return "%s(%s)" % (self.state, self.doesack) - return self.state + return "%s(%s)" % (state, self.doesack) + return state # set new state, return number of secs in previous state def newstate(self, state, when=0):