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