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