1
2
3
4
5
6
7
8
9
10
11
12
13
14 __doc__="""FileSystem
15
16 FileSystem is a file system on a server
17
18 $Id: FileSystem.py,v 1.12 2004/04/06 22:33:23 edahl Exp $"""
19
20 __version__ = "$Revision: 1.12 $"[11:-2]
21
22 import locale
23
24 from Globals import DTMLFile
25 from Globals import InitializeClass
26
27 from Products.ZenUtils.Utils import convToUnits
28 from Products.ZenRelations.RelSchema import *
29
30 from OSComponent import OSComponent
31 from Products.ZenUtils.Utils import prepId
32
43
44 addFileSystem = DTMLFile('dtml/addFileSystem',globals())
45
47 """FileSystem object"""
48
49 portal_type = meta_type = 'FileSystem'
50
51 manage_editFileSystemForm = DTMLFile('dtml/manageEditFileSystem',globals())
52
53 mount = ""
54 storageDevice = ""
55 type = ""
56 blockSize = 0
57 totalBlocks = 0L
58 totalFiles = 0L
59 capacity = 0
60 inodeCapacity = 0
61 maxNameLen = 0
62
63 _properties = OSComponent._properties + (
64 {'id':'mount', 'type':'string', 'mode':''},
65 {'id':'storageDevice', 'type':'string', 'mode':''},
66 {'id':'type', 'type':'string', 'mode':''},
67 {'id':'blockSize', 'type':'int', 'mode':''},
68 {'id':'totalBlocks', 'type':'long', 'mode':''},
69 {'id':'totalFiles', 'type':'long', 'mode':''},
70 {'id':'maxNameLen', 'type':'int', 'mode':''},
71 )
72 _relations = OSComponent._relations + (
73 ("os", ToOne(ToManyCont, "Products.ZenModel.OperatingSystem", "filesystems")),
74 )
75
76
77 factory_type_information = (
78 {
79 'id' : 'FileSystem',
80 'meta_type' : 'FileSystem',
81 'description' : """Arbitrary device grouping class""",
82 'icon' : 'FileSystem_icon.gif',
83 'product' : 'ZenModel',
84 'factory' : 'manage_addFileSystem',
85 'immediate_view' : 'viewFileSystem',
86 'actions' :
87 (
88 { 'id' : 'status'
89 , 'name' : 'Status'
90 , 'action' : 'viewFileSystem'
91 , 'permissions' : ('View',)
92 },
93 { 'id' : 'perfConf'
94 , 'name' : 'Template'
95 , 'action' : 'objTemplates'
96 , 'permissions' : ("Change Device", )
97 },
98 { 'id' : 'viewHistory'
99 , 'name' : 'Modifications'
100 , 'action' : 'viewHistory'
101 , 'permissions' : ('View',)
102 },
103 )
104 },
105 )
106
107
110
113
119
123
124
130
134
135
138
144
147
153
157
158
160 return ['usedBlocks_usedBlocks']
161
163 name = viewName
164
186
187
188 InitializeClass(FileSystem)
189