Skip to content

Commit

Permalink
[FIX] Installation bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MakarovS96 committed Apr 10, 2017
1 parent 2b57324 commit 202b92b
Showing 1 changed file with 48 additions and 23 deletions.
71 changes: 48 additions & 23 deletions cls/kutac/monitor/utils/Installer.cls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@
</Namespace>
</If>
<Namespace Name="${Namespace}" Create="no">
<IfDef Var="SourceDir">
<Log Text="SourceDir defined - offline install from ${SourceDir}" Level="0"/>
<RunInstall Class="kutac.monitor.utils.Installer" Method="OfflineInstall"/>
</IfDef>
<IfNotDef Var="SourceDir">
<Log Text="SourceDir undefined - online install from GitHub" Level="0"/>
<RunInstall Class="kutac.monitor.utils.Installer" Method="DownloadFromGitHub"/>
</IfNotDef>
</Namespace>
<Namespace Name="${Namespace}" Create="no" Code="${Namespace}" Data="${Namespace}" Ensemble="">
<Log Text="Mapping SYS.History package to choosed namespace." Level="0"/>
Expand All @@ -75,6 +61,18 @@
</Configuration>
</Namespace>
<Namespace Name="${Namespace}" Create="no">
<IfDef Var="SourceDir">
<Log Text="SourceDir defined - offline install from ${SourceDir}" Level="0"/>
<RunInstall Class="kutac.monitor.utils.Installer" Method="OfflineInstall"/>
</IfDef>
<IfNotDef Var="SourceDir">
<Log Text="SourceDir undefined - online install from GitHub" Level="0"/>
<RunInstall Class="kutac.monitor.utils.Installer" Method="DownloadFromGitHub"/>
</IfNotDef>
</Namespace>
<If Condition='##class(Config.Namespaces).Exists("MDX2JSON")'>
<Log Text="Setup DSW settings." Level="0"/>
<RunInstall Class="kutac.monitor.utils.Installer" Method="SetDSWSettings"/>
Expand Down Expand Up @@ -121,8 +119,23 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set namespace = tInstaller.Evaluate("${Namespace}")
do EnableDeepSee^%SYS.cspServer("/csp/"_$ZCONVERT(namespace, "L")_"/")
quit $$$OK
w "Turn on DeepSee flag on "_namespace_" Web Application.", !
set tSC = $$$OK
try {
new $Namespace
set $Namespace = "%SYS"
set tApplication = ##class(Security.Applications).%OpenId("/csp/"_$ZCONVERT(namespace, "L")_"/",,.tSC)
if $$$ISERR(tSC) {
quit
}
set tApplication.DeepSeeEnabled = 1
set tSC = tApplication.%Save()
} catch e {
set tSC = e.AsStatus()
}
quit tSC
]]></Implementation>
</Method>

Expand Down Expand Up @@ -497,19 +510,24 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
<Implementation><![CDATA[
Set Namespace=tInstaller.Evaluate("${Namespace}")
Do tInstaller.PushNS("%SYS")
write !, "Activating Monitor Classes"
do ..WriteLog("Activating Monitor Classes")
set st2 = ..ActivatingClasses()
write !, "Starting Monitor", !
do ..WriteLog("Starting Monitor")
set st3 = ..RunningMonitor()
&sql(select Name from %SYS.Task where Name = 'Rebuild SYSMON Cubes')
Do tInstaller.PopNS()
Do tInstaller.PushNS(Namespace)
&sql(select Name from %SYS.Task where Name = 'Rebuild SYSMON Cubes')
if +SQLCODE
if +SQLCODE
{
write "Creating Task",!
do ..WriteLog("Creating Task")
Do ##class(kutac.monitor.task.Builder).Setup()
}
Do tInstaller.PopNS()
set st = $$$ADDSC(st2, st3)
if $$$ISERR(st) Throw ##class(%Installer.Exception).CreateFromStatus(st)
quit $$$OK
Expand All @@ -530,7 +548,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
s class = ##class(%Monitor.ItemGroup).%OpenId(id)
if '$IsObject(class)
{
write !,"ERROR: Class '"_cls_"' does not exist",!
do ..WriteLog("ERROR: Class '"_cls_"' does not exist")
}
else
{
Expand All @@ -552,7 +570,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
<Implementation><![CDATA[
s sc = ##class(%SYS.Monitor).Stop()
s sc1 = ##class(%SYS.Monitor).Start()
w "System Monitor has been restarted!", !
do ..WriteLog("System Monitor has been restarted!")
return sc1
]]></Implementation>
</Method>
Expand Down Expand Up @@ -592,6 +610,13 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
]]></Implementation>
</Method>

<Method name="WriteLog">
<ClassMethod>1</ClassMethod>
<FormalSpec>text:%String</FormalSpec>
<Implementation><![CDATA[ w !, text, !
]]></Implementation>
</Method>

<XData name="DSWSettings">
<MimeType>text/plain</MimeType>
<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}}}}}}
Expand Down

0 comments on commit 202b92b

Please sign in to comment.