1
2
3
4
5
6
7
8
9
10
11
12
13
14 from Globals import InitializeClass
15 from AccessControl import ClassSecurityInfo
16
17 from Products.ZenModel.ZenossSecurity import *
18 from Products.ZenModel.ServiceClass import ServiceClass
19
20
21 STARTMODE_AUTO = 'Auto'
22 STARTMODE_MANUAL = 'Manual'
23 STARTMODE_DISABLED = 'Disabled'
24 STARTMODE_NOTINSTALLED = 'Not Installed'
25
26
28 """
29 Extends ServiceClass to add properties specific to Windows services.
30 """
31
32 monitoredStartModes = [STARTMODE_AUTO]
33
34 _properties = ServiceClass._properties + (
35 {'id': 'monitoredStartModes', 'type':'lines', 'mode':'rw'},
36 )
37
38 factory_type_information = ({
39 'id' : 'WinServiceClass',
40 'meta_type' : 'WinServiceClass',
41 'icon' : 'WinServiceClass.gif',
42 'product' : 'ZenModel',
43 'factory' : 'manage_addWinServiceClass',
44 'immediate_view' : 'winServiceClassStatus',
45 'actions': (
46 { 'id' : 'status'
47 , 'name' : 'Status'
48 , 'action' : 'winServiceClassStatus'
49 , 'permissions' : (ZEN_VIEW,),
50 },
51 { 'id' : 'edit'
52 , 'name' : 'Edit'
53 , 'action' : 'winServiceClassEdit'
54 , 'permissions' : (ZEN_MANAGE_DMD,),
55 },
56 { 'id' : 'manage'
57 , 'name' : 'Administration'
58 , 'action' : 'serviceClassManage'
59 , 'permissions' : (ZEN_MANAGE_DMD,)
60 },
61 { 'id' : 'zproperties'
62 , 'name' : 'Configuration Properties'
63 , 'action' : 'zPropertyEdit'
64 , 'permissions' : (ZEN_CHANGE_DEVICE,)
65 },
66 ),
67 },)
68
69 security = ClassSecurityInfo()
70
71
72 - def manage_editServiceClass(self, name="", monitor=False,
73 serviceKeys="", port=0, description="", monitoredStartModes=[],
74 REQUEST=None):
85
86
87 InitializeClass(WinServiceClass)
88