highlight "bad" states
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/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)
|
# Wait for heartbeat messages and act on them (or their absence)
|
||||||
#
|
#
|
||||||
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
|
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
|
||||||
@@ -75,9 +75,13 @@ class Host:
|
|||||||
return self.state
|
return self.state
|
||||||
|
|
||||||
def dispstate(self):
|
def dispstate(self):
|
||||||
|
if self.state in ["down","overdue"]:
|
||||||
|
state="<b>%s</b>" % self.state
|
||||||
|
else:
|
||||||
|
state="%s" % self.state
|
||||||
if self.doesack != "":
|
if self.doesack != "":
|
||||||
return "%s(%s)" % (self.state, self.doesack)
|
return "%s(%s)" % (state, self.doesack)
|
||||||
return self.state
|
return state
|
||||||
|
|
||||||
# set new state, return number of secs in previous state
|
# set new state, return number of secs in previous state
|
||||||
def newstate(self, state, when=0):
|
def newstate(self, state, when=0):
|
||||||
|
|||||||
Reference in New Issue
Block a user