1
2
3
4
5
6
7
8
9
10
11 __doc__="""Fan
12
13 Fan is an abstraction of any fan on a device. CPU, chassis, etc.
14
15 $Id: Fan.py,v 1.7 2004/04/06 22:33:24 edahl Exp $"""
16
17 __version__ = "$Revision: 1.7 $"[11:-2]
18
19 from Globals import InitializeClass
20
21 from Products.ZenRelations.RelSchema import *
22
23 from HWComponent import HWComponent
24
25 from Products.ZenModel.ZenossSecurity import *
26
27 -class Fan(HWComponent):
28 """Fan object"""
29
30 portal_type = meta_type = 'Fan'
31
32 state = "unknown"
33 type = "unknown"
34
35 _properties = HWComponent._properties + (
36 {'id':'state', 'type':'string', 'mode':'w'},
37 {'id':'type', 'type':'string', 'mode':'w'},
38 )
39
40 _relations = HWComponent._relations + (
41 ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW", "fans")),
42 )
43
44
45 factory_type_information = (
46 {
47 'id' : 'Fan',
48 'meta_type' : 'Fan',
49 'description' : """Arbitrary device grouping class""",
50 'icon' : 'Fan_icon.gif',
51 'product' : 'ZenModel',
52 'factory' : 'manage_addFan',
53 'immediate_view' : 'viewFan',
54 'actions' :
55 (
56 { 'id' : 'status'
57 , 'name' : 'Status'
58 , 'action' : 'viewFan'
59 , 'permissions' : ('View',)
60 },
61 { 'id' : 'perfConf'
62 , 'name' : 'Template'
63 , 'action' : 'objTemplates'
64 , 'permissions' : ("Change Device", )
65 },
66 )
67 },
68 )
69
70
72 """
73 Return a string representation of the RPM
74 """
75 rpm = self.rpm()
76 return rpm is None and "unknown" or "%lrpm" % (rpm,)
77
78
79 - def rpm(self, default=None):
87
88
91 name = viewName
92
93
94 InitializeClass(Fan)
95