Skip to content

Commit 202b92b

Browse files
committed
[FIX] Installation bugs
1 parent 2b57324 commit 202b92b

File tree

1 file changed

+48
-23
lines changed

1 file changed

+48
-23
lines changed

cls/kutac/monitor/utils/Installer.cls.xml

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@
4141
</Namespace>
4242
</If>
4343
44-
45-
<Namespace Name="${Namespace}" Create="no">
46-
<IfDef Var="SourceDir">
47-
<Log Text="SourceDir defined - offline install from ${SourceDir}" Level="0"/>
48-
<RunInstall Class="kutac.monitor.utils.Installer" Method="OfflineInstall"/>
49-
</IfDef>
50-
51-
<IfNotDef Var="SourceDir">
52-
<Log Text="SourceDir undefined - online install from GitHub" Level="0"/>
53-
<RunInstall Class="kutac.monitor.utils.Installer" Method="DownloadFromGitHub"/>
54-
</IfNotDef>
55-
</Namespace>
56-
57-
5844
<Namespace Name="${Namespace}" Create="no" Code="${Namespace}" Data="${Namespace}" Ensemble="">
5945
<Log Text="Mapping SYS.History package to choosed namespace." Level="0"/>
6046
@@ -75,6 +61,18 @@
7561
</Configuration>
7662
</Namespace>
7763
64+
<Namespace Name="${Namespace}" Create="no">
65+
<IfDef Var="SourceDir">
66+
<Log Text="SourceDir defined - offline install from ${SourceDir}" Level="0"/>
67+
<RunInstall Class="kutac.monitor.utils.Installer" Method="OfflineInstall"/>
68+
</IfDef>
69+
70+
<IfNotDef Var="SourceDir">
71+
<Log Text="SourceDir undefined - online install from GitHub" Level="0"/>
72+
<RunInstall Class="kutac.monitor.utils.Installer" Method="DownloadFromGitHub"/>
73+
</IfNotDef>
74+
</Namespace>
75+
7876
<If Condition='##class(Config.Namespaces).Exists("MDX2JSON")'>
7977
<Log Text="Setup DSW settings." Level="0"/>
8078
<RunInstall Class="kutac.monitor.utils.Installer" Method="SetDSWSettings"/>
@@ -121,8 +119,23 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
121119
<ReturnType>%Status</ReturnType>
122120
<Implementation><![CDATA[
123121
set namespace = tInstaller.Evaluate("${Namespace}")
124-
do EnableDeepSee^%SYS.cspServer("/csp/"_$ZCONVERT(namespace, "L")_"/")
125-
quit $$$OK
122+
w "Turn on DeepSee flag on "_namespace_" Web Application.", !
123+
set tSC = $$$OK
124+
try {
125+
new $Namespace
126+
set $Namespace = "%SYS"
127+
128+
set tApplication = ##class(Security.Applications).%OpenId("/csp/"_$ZCONVERT(namespace, "L")_"/",,.tSC)
129+
if $$$ISERR(tSC) {
130+
quit
131+
}
132+
133+
set tApplication.DeepSeeEnabled = 1
134+
set tSC = tApplication.%Save()
135+
} catch e {
136+
set tSC = e.AsStatus()
137+
}
138+
quit tSC
126139
]]></Implementation>
127140
</Method>
128141

@@ -497,19 +510,24 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
497510
<Implementation><![CDATA[
498511
Set Namespace=tInstaller.Evaluate("${Namespace}")
499512
Do tInstaller.PushNS("%SYS")
500-
write !, "Activating Monitor Classes"
513+
514+
do ..WriteLog("Activating Monitor Classes")
501515
set st2 = ..ActivatingClasses()
502-
write !, "Starting Monitor", !
516+
517+
do ..WriteLog("Starting Monitor")
503518
set st3 = ..RunningMonitor()
519+
520+
&sql(select Name from %SYS.Task where Name = 'Rebuild SYSMON Cubes')
504521
Do tInstaller.PopNS()
522+
505523
Do tInstaller.PushNS(Namespace)
506-
&sql(select Name from %SYS.Task where Name = 'Rebuild SYSMON Cubes')
507-
if +SQLCODE
524+
if +SQLCODE
508525
{
509-
write "Creating Task",!
526+
do ..WriteLog("Creating Task")
510527
Do ##class(kutac.monitor.task.Builder).Setup()
511528
}
512529
Do tInstaller.PopNS()
530+
513531
set st = $$$ADDSC(st2, st3)
514532
if $$$ISERR(st) Throw ##class(%Installer.Exception).CreateFromStatus(st)
515533
quit $$$OK
@@ -530,7 +548,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
530548
s class = ##class(%Monitor.ItemGroup).%OpenId(id)
531549
if '$IsObject(class)
532550
{
533-
write !,"ERROR: Class '"_cls_"' does not exist",!
551+
do ..WriteLog("ERROR: Class '"_cls_"' does not exist")
534552
}
535553
else
536554
{
@@ -552,7 +570,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
552570
<Implementation><![CDATA[
553571
s sc = ##class(%SYS.Monitor).Stop()
554572
s sc1 = ##class(%SYS.Monitor).Start()
555-
w "System Monitor has been restarted!", !
573+
do ..WriteLog("System Monitor has been restarted!")
556574
return sc1
557575
]]></Implementation>
558576
</Method>
@@ -592,6 +610,13 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
592610
]]></Implementation>
593611
</Method>
594612

613+
<Method name="WriteLog">
614+
<ClassMethod>1</ClassMethod>
615+
<FormalSpec>text:%String</FormalSpec>
616+
<Implementation><![CDATA[ w !, text, !
617+
]]></Implementation>
618+
</Method>
619+
595620
<XData name="DSWSettings">
596621
<MimeType>text/plain</MimeType>
597622
<Data><![CDATA[{"Default":{"addons":"","app":{"language":"en","hideFolders":false,"showImages":true,"isMetro":false},"namespaces":{"widgets":{"mobile/Current Performance Indicators.dashboard":{"ObjPerf":{"sizeY":7,"sizeX":3,"col":6},"GlobPerf":{"col":4,"sizeY":5,"sizeX":2}},"mobile/GloPerf.dashboard":{"w2":{"sizeY":5,"sizeX":10}},"dash/actions/State Info.dashboard":{"Widget1":{"col":0}},"mobile/ObjPerf.dashboard":{"_filters":[{"targetProperty":"[Measurement Date].[H1].[Month]","value":"&[NOW]"},{"targetProperty":"[Measurement Date].[H1].[Day]","value":"&[13]"}]},"mobile/DBSizes.dashboard":{"w2":{"series":{}}}},"tiles":{"mobile/":{"":{"row":0,"col":0,"sizeX":1,"sizeY":1,"color":2,"fontColor":0,"icon":27,"title":""},"CPU Utilization":{"row":0,"col":1,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"CPU Utilization"},"Current Performance Indicators":{"row":3,"col":2,"sizeX":2,"sizeY":2,"color":1,"fontColor":0,"icon":0,"hideTitle":true,"widget":0,"title":"Current Performance Indicators"},"Current Performance Objects":{"row":0,"col":5,"sizeX":3,"sizeY":3,"color":1,"fontColor":0,"icon":0,"widget":1,"title":"Current Performance Objects","hideTitle":true},"Database Sizes":{"row":0,"col":2,"sizeX":3,"sizeY":3,"color":1,"fontColor":0,"icon":0,"widget":1,"title":"Database Sizes"},"Globals Performance":{"row":4,"col":1,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"Globals Performance"},"Journal size history":{"row":3,"col":1,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"Journal size history"},"License History":{"row":2,"col":1,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"License History"},"Object Performance":{"row":1,"col":1,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"Object Performance"},"Routines Performance History":{"row":0,"col":8,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"Routines Performance History"},"Various System Parameters Performance":{"row":3,"col":4,"sizeX":4,"sizeY":2,"color":1,"fontColor":0,"icon":0,"widget":0,"title":"Various System Parameters Performance","hideTitle":true},"WIJ Performance":{"row":0,"col":9,"sizeX":1,"sizeY":1,"color":1,"fontColor":0,"icon":0,"title":"WIJ Performance"},"Current CPU Parameters":{"row":1,"col":8,"sizeX":2,"sizeY":2,"color":1,"fontColor":0,"icon":0,"hideTitle":true,"title":"Current CPU Parameters","widget":0},"Current License Count":{"row":3,"col":8,"sizeX":2,"sizeY":2,"color":1,"fontColor":0,"icon":1,"title":"Current License Count","hideTitle":true,"widget":0}}}}}}

0 commit comments

Comments
 (0)