Package ZenModel :: Module StatusColor
[hide private]
[frames] | no frames]

Source Code for Module ZenModel.StatusColor

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2007, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 as published by 
 8  # the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  __doc__="""Status 
15   
16  StatusColor class is a base for things which have status 
17  that needs to be represented in html with color. 
18   
19  $Id: StatusColor.py,v 1.8 2004/04/04 01:51:19 edahl Exp $""" 
20   
21  __version__ = "$Revision: 1.8 $"[11:-2] 
22   
23 -class StatusColor:
24 """Status object""" 25
26 - def devStatusColor(self, status):
27 retval="#00ff00" 28 if status == -1: 29 retval = "#d02090" 30 elif status == -2: 31 retval = "#ff9900" 32 elif status > 0: 33 retval = "#ff0000" 34 return retval
35
36 - def pingColor(self):
37 return self.statusColor(self.pingStatus)
38
39 - def snmpColor(self):
40 return self.statusColor(self.snmpStatus)
41