diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c2bc05
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+build/
+node_modules/
+package-lock.json
+.idea/
\ No newline at end of file
diff --git a/Installer.xml b/Installer.xml
new file mode 100644
index 0000000..bb2683d
--- /dev/null
+++ b/Installer.xml
@@ -0,0 +1,398 @@
+
+
+
+64536,78183.96318
+63732,50627.865496
+
+
+INSTALLER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+
+ This is a method generator whose code is generated by XGL.
+Set pVars("Namespace")="SYSMON"
+Set pVars("SourceDir")="C:\temp\SYSMON\cls\kutac\"
+do ##class(kutac.monitor.utils.Installer).setup(.pVars)
+1
+1
+objectgenerator
+
+%Status
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+%Status
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+%Status
+
+
+
+
+1
+%Status
+
+
+
+
+1
+%Status
+
+
+
+
+1
+
+%Status
+
+
+
+
+1
+text:%String
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+%Status
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+
+
+
+
+1
+pVars,pLogLevel,tInstaller
+
+
+
+
diff --git a/cls/kutac/REST/ConfigBroker.cls b/cls/kutac/REST/ConfigBroker.cls
new file mode 100644
index 0000000..1f36c6b
--- /dev/null
+++ b/cls/kutac/REST/ConfigBroker.cls
@@ -0,0 +1,113 @@
+Import kutac.REST
+
+Include %ZEN.Utils
+
+Class kutac.REST.ConfigBroker Extends %CSP.REST
+{
+
+XData UrlMap
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+ClassMethod getClasses() As %Status
+{
+ quit ##class(Utils).getClasses()
+}
+
+ClassMethod toggleClass() As %Status
+{
+ do ..ConvertRequestBody()
+ quit ##class(Utils).toggleClass(%request.Content.classname, %request.Content.check)
+}
+
+ClassMethod checkMon() As %Status
+{
+ quit ##class(Utils).checkMon()
+}
+
+ClassMethod toggleMon() As %Status
+{
+ do ..ConvertRequestBody()
+ quit ##class(Utils).toggleMon(%request.Content.toggle)
+}
+
+ClassMethod getEmailSettings()
+{
+ quit ##class(kutac.REST.Utils).getEmailSettings()
+}
+
+ClassMethod setEmailSettings()
+{
+ do ..ConvertRequestBody()
+ set obj = %request.Content
+
+ quit ##class(Utils).setEmailSettings(obj)
+}
+
+ClassMethod toggleEmail()
+{
+ do ..ConvertRequestBody()
+ quit ##class(Utils).toggleEmail(%request.Content.toggle)
+}
+
+ClassMethod getRecipients()
+{
+ quit ##class(Utils).getRecipients()
+}
+
+ClassMethod addRecipient()
+{
+ do ..ConvertRequestBody()
+ quit ##class(Utils).addRecipient(%request.Content.rec)
+}
+
+ClassMethod deleteRecipient()
+{
+ do ..ConvertRequestBody()
+ quit ##class(Utils).deleteRecipient(%request.Content.rec)
+}
+
+ClassMethod testMail()
+{
+ quit ##class(Utils).testMail()
+}
+
+ClassMethod ConvertRequestBody() As %Status
+{
+ #dim %request As %CSP.Request
+ #dim obj As %ZEN.proxyObject
+
+ return:'$isobject(%request.Content) $$$OK //empty request body - nothing to do
+
+ // Convert request body into UTF8 proxyObject
+ set content = %request.Content.Read($$$MaxStringLength)
+ set content = $ZCVT(content,"I","UTF8")
+ set st = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(content,,.obj,1)
+ return:$$$ISERR(st) st
+ return:'$IsObject(obj) $$$ERROR($$$ArgumentIsNotAnObject,"Body")
+
+ set %request.Content = obj // obj here is a valid UTF8 proxyObject with required property
+ return $$$OK
+}
+
+/// Specifies the default character set for the page. This can be overriden using the
+/// <CSP:CONTENT CHARSET=> tag, or by setting the %response.CharSet property
+/// in the OnPreHTTP method. If this parameter is not specified, then
+/// for the default charset is utf-8.
+Parameter CHARSET = "UTF-8";
+
+}
+
diff --git a/cls/kutac/REST/ConfigBroker.cls.xml b/cls/kutac/REST/ConfigBroker.cls.xml
deleted file mode 100644
index c0acebc..0000000
--- a/cls/kutac/REST/ConfigBroker.cls.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-kutac.REST
-%ZEN.Utils
-%CSP.REST
-64469,36696.045094
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-1
-%Status
-
-
-
-
-1
-%Status
-
-
-
-
-1
-%Status
-
-
-
-
-1
-%Status
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-
-
-
-
-1
-%Status
-
-
-
-
-%response.CharSet property
-in the OnPreHTTP method. If this parameter is not specified, then
-for the default charset is utf-8.]]>
-UTF-8
-
-
-
diff --git a/cls/kutac/REST/Utils.cls.xml b/cls/kutac/REST/Utils.cls
similarity index 74%
rename from cls/kutac/REST/Utils.cls.xml
rename to cls/kutac/REST/Utils.cls
index 7ba0f89..2acde21 100644
--- a/cls/kutac/REST/Utils.cls.xml
+++ b/cls/kutac/REST/Utils.cls
@@ -1,12 +1,8 @@
-
-
-
-64470,35752.623647
+Class kutac.REST.Utils
+{
-
-1
-%Status
-
-
+}
-
-1
-classname,check
-%Status
-
-
+}
-
-1
-%Status
-
-
+}
-
-1
-toggle
-%Status
-
-
+}
-
-1
-%Status
-
-
+}
-
-1
-obj:%ZEN.proxyObject
-%Status
-
-
+}
-
-1
-toggle
-
-
+}
-
-1
-rec
-
-
+}
-
-1
-rec
-
-
+}
-
-1
-
-
+}
-
-1
-
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/cubes/CurrentSysDataDB.cls.xml b/cls/kutac/monitor/cubes/CurrentSysDataDB.cls
similarity index 61%
rename from cls/kutac/monitor/cubes/CurrentSysDataDB.cls.xml
rename to cls/kutac/monitor/cubes/CurrentSysDataDB.cls
index 97f07b8..9ae0b6d 100644
--- a/cls/kutac/monitor/cubes/CurrentSysDataDB.cls.xml
+++ b/cls/kutac/monitor/cubes/CurrentSysDataDB.cls
@@ -1,22 +1,12 @@
-
-
-
-
-
-1
-%DeepSee.CubeDefinition
-63536,55156.012674
-kutac.monitor.current.SysDataDB
+///
+Class kutac.monitor.cubes.CurrentSysDataDB Extends %DeepSee.CubeDefinition [ DependsOn = kutac.monitor.current.SysDataDB, ProcedureBlock ]
+{
-
-SYSMON
-
+Parameter DOMAIN = "SYSMON";
-
-
-Cube definition from Architect.
-http://www.intersystems.com/deepsee
-
@@ -27,7 +17,7 @@ Cube definition from Architect.
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/cubes/HistoryPerfData.cls.xml b/cls/kutac/monitor/cubes/HistoryPerfData.cls
similarity index 94%
rename from cls/kutac/monitor/cubes/HistoryPerfData.cls.xml
rename to cls/kutac/monitor/cubes/HistoryPerfData.cls
index 6551459..cd1ca62 100644
--- a/cls/kutac/monitor/cubes/HistoryPerfData.cls.xml
+++ b/cls/kutac/monitor/cubes/HistoryPerfData.cls
@@ -1,18 +1,10 @@
-
-
-
-
-
-1
-%DeepSee.CubeDefinition
-63327,55773.939425
-kutac.monitor.history.PerfData
+///
+Class kutac.monitor.cubes.HistoryPerfData Extends %DeepSee.CubeDefinition [ DependsOn = kutac.monitor.history.PerfData, ProcedureBlock ]
+{
-
-
-Cube definition from Architect.
-http://www.intersystems.com/deepsee
-
@@ -121,11 +113,9 @@ Cube definition from Architect.
-]]>
-
+}
+
+Parameter DOMAIN = "SYSMON";
+
+}
-
-SYSMON
-
-
-
diff --git a/cls/kutac/monitor/cubes/HistoryPerfDataWD.cls.xml b/cls/kutac/monitor/cubes/HistoryPerfDataWD.cls
similarity index 85%
rename from cls/kutac/monitor/cubes/HistoryPerfDataWD.cls.xml
rename to cls/kutac/monitor/cubes/HistoryPerfDataWD.cls
index 515d425..47e21b4 100644
--- a/cls/kutac/monitor/cubes/HistoryPerfDataWD.cls.xml
+++ b/cls/kutac/monitor/cubes/HistoryPerfDataWD.cls
@@ -1,18 +1,10 @@
-
-
-
-
-
-1
-%DeepSee.CubeDefinition
-63543,55927.213079
-kutac.monitor.history.PerfDataWD
+///
+Class kutac.monitor.cubes.HistoryPerfDataWD Extends %DeepSee.CubeDefinition [ DependsOn = kutac.monitor.history.PerfDataWD, ProcedureBlock ]
+{
-
-
-Cube definition from Architect.
-http://www.intersystems.com/deepsee
-
@@ -57,11 +49,9 @@ Cube definition from Architect.
-]]>
-
+}
+
+Parameter DOMAIN = "SYSMON";
+
+}
-
-SYSMON
-
-
-
diff --git a/cls/kutac/monitor/cubes/HistorySysData.cls.xml b/cls/kutac/monitor/cubes/HistorySysData.cls
similarity index 90%
rename from cls/kutac/monitor/cubes/HistorySysData.cls.xml
rename to cls/kutac/monitor/cubes/HistorySysData.cls
index 844766e..ba66fe1 100644
--- a/cls/kutac/monitor/cubes/HistorySysData.cls.xml
+++ b/cls/kutac/monitor/cubes/HistorySysData.cls
@@ -1,18 +1,10 @@
-
-
-
-
-
-1
-%DeepSee.CubeDefinition
-63539,56609.115575
-kutac.monitor.history.SysData
+///
+Class kutac.monitor.cubes.HistorySysData Extends %DeepSee.CubeDefinition [ DependsOn = kutac.monitor.history.SysData, ProcedureBlock ]
+{
-
-
-Cube definition from Architect.
-http://www.intersystems.com/deepsee
-
@@ -75,11 +67,9 @@ Cube definition from Architect.
-]]>
-
+}
+
+Parameter DOMAIN = "SYSMON";
+
+}
-
-SYSMON
-
-
-
diff --git a/cls/kutac/monitor/cubes/HistorySysDataDB.cls.xml b/cls/kutac/monitor/cubes/HistorySysDataDB.cls
similarity index 78%
rename from cls/kutac/monitor/cubes/HistorySysDataDB.cls.xml
rename to cls/kutac/monitor/cubes/HistorySysDataDB.cls
index c662d59..2f8d609 100644
--- a/cls/kutac/monitor/cubes/HistorySysDataDB.cls.xml
+++ b/cls/kutac/monitor/cubes/HistorySysDataDB.cls
@@ -1,22 +1,12 @@
-
-
-
-
-
-1
-%DeepSee.CubeDefinition
-63536,55156.012674
-kutac.monitor.current.SysDataDB
+///
+Class kutac.monitor.cubes.HistorySysDataDB Extends %DeepSee.CubeDefinition [ DependsOn = kutac.monitor.current.SysDataDB, ProcedureBlock ]
+{
-
-SYSMON
-
+Parameter DOMAIN = "SYSMON";
-
-
-Cube definition from Architect.
-http://www.intersystems.com/deepsee
-
@@ -43,7 +33,7 @@ Cube definition from Architect.
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/current/PerfData.cls b/cls/kutac/monitor/current/PerfData.cls
new file mode 100644
index 0000000..b311783
--- /dev/null
+++ b/cls/kutac/monitor/current/PerfData.cls
@@ -0,0 +1,57 @@
+/// kutac.monitor.current.PerfData
+Class kutac.monitor.current.PerfData Extends %DeepSee.KPI
+{
+
+Parameter DOMAIN = "SYSMON";
+
+Parameter RESOURCE;
+
+/// This XData definition defines the KPI.
+XData KPI [ XMLNamespace = "http://www.intersystems.com/deepsee/kpi" ]
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+/// Notification that this KPI is being executed.
+/// This is a good place to override properties, such as range and threshold.
+Method %OnLoadKPI() As %Status
+{
+ Quit $$$OK
+}
+
+/// Return an SQL statement to execute.
+Method %OnGetSQL(ByRef pSQL As %String) As %Status
+{
+ set pSQL = "SELECT top 1 ID, DateTime, Perf_GloRef, Perf_PhysReads, Perf_PhysWrites, Perf_ObjHit, Perf_ObjDel, Perf_ObjMiss, Perf_ObjNew,"_
+ " Perf_ObjLoad, Perf_RtnLoad, Perf_RtnCallLocal, Perf_WIJWrites FROM SYS_History.PerfData order by DateTime Desc"
+ Quit $$$OK
+}
+
+/// This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
+ClassMethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) As %Status
+{
+ // pAction is the name of the action (as defined in the XML list).
+ // pContext contains information from the client
+ // and can be used to return information.
+ Quit $$$OK
+}
+
+}
+
diff --git a/cls/kutac/monitor/current/PerfData.cls.xml b/cls/kutac/monitor/current/PerfData.cls.xml
deleted file mode 100644
index 4ac8ae1..0000000
--- a/cls/kutac/monitor/current/PerfData.cls.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-kutac.monitor.current.PerfData
-%DeepSee.KPI
-63327,59848.173621
-
-
-SYSMON
-
-
-
-
-
-
-
-This XData definition defines the KPI.
-http://www.intersystems.com/deepsee/kpi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-Notification that this KPI is being executed.
-This is a good place to override properties, such as range and threshold.
-%Status
-
-
-
-
-
-Return an SQL statement to execute.
-
-%Status
-
-
-
-
-
-This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
-1
-pAction:%String,pContext:%ZEN.proxyObject
-%Status
-
-
-
-
diff --git a/cls/kutac/monitor/current/SysData.cls b/cls/kutac/monitor/current/SysData.cls
new file mode 100644
index 0000000..4572fea
--- /dev/null
+++ b/cls/kutac/monitor/current/SysData.cls
@@ -0,0 +1,74 @@
+Class kutac.monitor.current.SysData Extends %DeepSee.KPI
+{
+
+Parameter DOMAIN = "SYSMON";
+
+Parameter RESOURCE;
+
+/// This XData definition defines the KPI.
+XData KPI [ XMLNamespace = "http://www.intersystems.com/deepsee/kpi" ]
+{
+
+
+
+
+
+
+
+
+
+}
+
+/// Notification that this KPI is being executed.
+/// This is a good place to override properties, such as range and threshold.
+Method %OnLoadKPI() As %Status
+{
+ Quit $$$OK
+}
+
+/// Return an SQL statement to execute.
+Method %OnGetSQL(ByRef pSQL As %String) As %Status
+{
+ set pSQL = "SELECT top 1 ID, DateTime, Sys_CPUIdle, Sys_CPUKernel, Sys_CPUUser, Sys_LicUsedDist "_
+ "FROM SYS_History.SysData order by DateTime Desc"
+ Quit $$$OK
+}
+
+/// This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
+ClassMethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) As %Status
+{
+ // pAction is the name of the action (as defined in the XML list).
+ // pContext contains information from the client
+ // and can be used to return information.
+ Quit $$$OK
+}
+
+/// Get data for this KPI manually.
+/// This is implemented by subclasses that provide manual data.
+Method %OnExecute() As %Status
+{
+ Set tSC = $$$OK
+ Try {
+ &sql(SELECT top 1 ID, DateTime, Sys_CPUIdle, Sys_CPUKernel, Sys_CPUUser, Sys_LicUsedDist
+ INTO :ID, :DateTime, :SysCPUIdle, :SysCPUKernel, :SysCPUUser, :SysLicUsedDist
+ FROM SYS_History.SysData
+ ORDER BY DateTime DESC)
+ set ..%data(1,"ID") = ID
+ set ..%data(1,"DateTime") = DateTime
+ set ..%data(1,"SysCPUIdle") = SysCPUIdle
+ set ..%data(1,"SysCPUKernel") = SysCPUKernel
+ set ..%data(1,"SysCPUUser") = SysCPUUser
+ set ..%data(1,"SysLicUsedDist") = SysLicUsedDist
+ set ..%data(1,"SysLicUsedLocal") = $system.License.GetUserLimit()
+ }
+ Catch(ex) {
+ Set tSC = ex.AsStatus()
+ }
+ Quit tSC
+}
+
+}
+
diff --git a/cls/kutac/monitor/current/SysData.cls.xml b/cls/kutac/monitor/current/SysData.cls.xml
deleted file mode 100644
index 27bb8ff..0000000
--- a/cls/kutac/monitor/current/SysData.cls.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-%DeepSee.KPI
-64174,58852.733443
-
-
-SYSMON
-
-
-
-
-
-
-
-This XData definition defines the KPI.
-http://www.intersystems.com/deepsee/kpi
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-Notification that this KPI is being executed.
-This is a good place to override properties, such as range and threshold.
-%Status
-
-
-
-
-
-Return an SQL statement to execute.
-
-%Status
-
-
-
-
-
-This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
-1
-pAction:%String,pContext:%ZEN.proxyObject
-%Status
-
-
-
-
-
-Get data for this KPI manually.
-This is implemented by subclasses that provide manual data.
-%Status
-
-
-
-
diff --git a/cls/kutac/monitor/current/SysDataDB.cls.xml b/cls/kutac/monitor/current/SysDataDB.cls
similarity index 56%
rename from cls/kutac/monitor/current/SysDataDB.cls.xml
rename to cls/kutac/monitor/current/SysDataDB.cls
index 2775f98..f27362b 100644
--- a/cls/kutac/monitor/current/SysDataDB.cls.xml
+++ b/cls/kutac/monitor/current/SysDataDB.cls
@@ -1,24 +1,16 @@
-
-
-
-%DeepSee.DataConnector
-63327,55338.349448
+Class kutac.monitor.current.SysDataDB Extends %DeepSee.DataConnector
+{
-
-1
-
+Parameter SUPPORTSIDLIST = 1;
-
-http://www.intersystems.com/deepsee/connector/query
-SELECT d.datetime,db.* FROM SYS_History.SysData_DB db,SYS_History.SysData d
WHERE db.SysData = d.id and (d.datetime = (select top 1 datetime from SYS_History.SysData order by datetime desc ))
-]]>
-
+}
-
-http://www.intersystems.com/deepsee/connector/output
-
@@ -26,7 +18,7 @@
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/history/PerfData.cls.xml b/cls/kutac/monitor/history/PerfData.cls
similarity index 86%
rename from cls/kutac/monitor/history/PerfData.cls.xml
rename to cls/kutac/monitor/history/PerfData.cls
index 04d0f68..eb3e61c 100644
--- a/cls/kutac/monitor/history/PerfData.cls.xml
+++ b/cls/kutac/monitor/history/PerfData.cls
@@ -1,22 +1,15 @@
-
-
-
-%DeepSee.DataConnector
-63327,55338.349448
+Class kutac.monitor.history.PerfData Extends %DeepSee.DataConnector
+{
-
-1
-
+Parameter SUPPORTSIDLIST = 1;
-
-http://www.intersystems.com/deepsee/connector/query
-SELECT * FROM SYS_History.PerfData
-]]>
-
+XData SourceQuery [ XMLNamespace = "http://www.intersystems.com/deepsee/connector/query" ]
+{
+SELECT * FROM SYS_History.PerfData
+}
-
-http://www.intersystems.com/deepsee/connector/output
-
@@ -59,7 +52,7 @@
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/history/PerfDataWD.cls.xml b/cls/kutac/monitor/history/PerfDataWD.cls
similarity index 75%
rename from cls/kutac/monitor/history/PerfDataWD.cls.xml
rename to cls/kutac/monitor/history/PerfDataWD.cls
index c8c682c..9f6446a 100644
--- a/cls/kutac/monitor/history/PerfDataWD.cls.xml
+++ b/cls/kutac/monitor/history/PerfDataWD.cls
@@ -1,22 +1,15 @@
-
-
-
-%DeepSee.DataConnector
-63327,55338.349448
+Class kutac.monitor.history.PerfDataWD Extends %DeepSee.DataConnector
+{
-
-1
-
+Parameter SUPPORTSIDLIST = 1;
-
-http://www.intersystems.com/deepsee/connector/query
-SELECT wd.*,d.datetime FROM SYS_History.PerfData_WD wd, SYS_History.PerfData d WHERE wd.PerfData = d.id
-]]>
-
+XData SourceQuery [ XMLNamespace = "http://www.intersystems.com/deepsee/connector/query" ]
+{
+SELECT wd.*,d.datetime FROM SYS_History.PerfData_WD wd, SYS_History.PerfData d WHERE wd.PerfData = d.id
+}
-
-http://www.intersystems.com/deepsee/connector/output
-
@@ -33,7 +26,7 @@
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/history/SysData.cls.xml b/cls/kutac/monitor/history/SysData.cls
similarity index 72%
rename from cls/kutac/monitor/history/SysData.cls.xml
rename to cls/kutac/monitor/history/SysData.cls
index d5661b5..a23884e 100644
--- a/cls/kutac/monitor/history/SysData.cls.xml
+++ b/cls/kutac/monitor/history/SysData.cls
@@ -1,22 +1,15 @@
-
-
-
-%DeepSee.DataConnector
-63327,55338.349448
+Class kutac.monitor.history.SysData Extends %DeepSee.DataConnector
+{
-
-1
-
+Parameter SUPPORTSIDLIST = 1;
-
-http://www.intersystems.com/deepsee/connector/query
-SELECT * FROM SYS_History.SysData
-]]>
-
+XData SourceQuery [ XMLNamespace = "http://www.intersystems.com/deepsee/connector/query" ]
+{
+SELECT * FROM SYS_History.SysData
+}
-
-http://www.intersystems.com/deepsee/connector/output
-
@@ -33,7 +26,7 @@
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/history/SysDataDB.cls b/cls/kutac/monitor/history/SysDataDB.cls
new file mode 100644
index 0000000..63488fb
--- /dev/null
+++ b/cls/kutac/monitor/history/SysDataDB.cls
@@ -0,0 +1,23 @@
+Class kutac.monitor.history.SysDataDB Extends %DeepSee.DataConnector
+{
+
+Parameter SUPPORTSIDLIST = 1;
+
+XData SourceQuery [ XMLNamespace = "http://www.intersystems.com/deepsee/connector/query" ]
+{
+SELECT db.*,d.datetime FROM SYS_History.SysData_DB db,SYS_History.SysData d WHERE db.SysData = d.id order by datetime desc
+}
+
+XData Output [ XMLNamespace = "http://www.intersystems.com/deepsee/connector/output" ]
+{
+
+
+
+
+
+
+
+}
+
+}
+
diff --git a/cls/kutac/monitor/history/SysDataDB.cls.xml b/cls/kutac/monitor/history/SysDataDB.cls.xml
deleted file mode 100644
index a62990e..0000000
--- a/cls/kutac/monitor/history/SysDataDB.cls.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-%DeepSee.DataConnector
-63327,55338.349448
-
-
-1
-
-
-
-http://www.intersystems.com/deepsee/connector/query
-SELECT db.*,d.datetime FROM SYS_History.SysData_DB db,SYS_History.SysData d WHERE db.SysData = d.id order by datetime desc
-]]>
-
-
-
-http://www.intersystems.com/deepsee/connector/output
-
-
-
-
-
-
-
-]]>
-
-
-
diff --git a/cls/kutac/monitor/kpi/Actions.cls.xml b/cls/kutac/monitor/kpi/Actions.cls
similarity index 53%
rename from cls/kutac/monitor/kpi/Actions.cls.xml
rename to cls/kutac/monitor/kpi/Actions.cls
index 074a999..9c13d9f 100644
--- a/cls/kutac/monitor/kpi/Actions.cls.xml
+++ b/cls/kutac/monitor/kpi/Actions.cls
@@ -1,23 +1,14 @@
-
-
-
-
-kutac.monitor.kpi.Actions
-%DeepSee.KPI
-63539,37088.160357
+/// kutac.monitor.kpi.Actions
+Class kutac.monitor.kpi.Actions Extends %DeepSee.KPI
+{
-
-SYSMON
-
+Parameter DOMAIN = "SYSMON";
-
-
+Parameter RESOURCE;
-
-
-This XData definition defines the KPI.
-http://www.intersystems.com/deepsee/kpi
-
@@ -32,36 +23,25 @@ This XData definition defines the KPI.
-]]>
-
+}
-
-
-Notification that this KPI is being executed.
-This is a good place to override properties, such as range and threshold.
-%Status
-
-
+/// Notification that this KPI is being executed.
+/// This is a good place to override properties, such as range and threshold.
+Method %OnLoadKPI() As %Status
+{
+ Quit $$$OK
+}
-
-
-Return an MDX statement to execute.
-
-%Status
-
-
+}
-
-
-This callback is invoked from a dashboard when an action defined by this dashboard is invoked.
-1
-pAction:%String,pContext:%ZEN.proxyObject
-%Status
-
-
+}
-
-
-Get data for this KPI manually.
-This is implemented by subclasses that provide manual data.
-%Status
-
Set tSC = ex.AsStatus()
}
Quit tSC
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/library/Dashboards.cls.xml b/cls/kutac/monitor/library/Dashboards.cls
similarity index 98%
rename from cls/kutac/monitor/library/Dashboards.cls.xml
rename to cls/kutac/monitor/library/Dashboards.cls
index 659866c..8be4a30 100644
--- a/cls/kutac/monitor/library/Dashboards.cls.xml
+++ b/cls/kutac/monitor/library/Dashboards.cls
@@ -1,15 +1,10 @@
-
-
-
-%DeepSee.UserLibrary.Container
-63327,60672.446665
-
-
-
-This XData section contains the contents of this container.
-Typically this is an xml document representing a Dashboard or Pivot.
-http://www.intersystems.com/deepsee/library
-
@@ -249,7 +244,7 @@ Typically this is an xml document representing a Dashboard or Pivot.
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/library/Mobile.cls.xml b/cls/kutac/monitor/library/Mobile.cls
similarity index 98%
rename from cls/kutac/monitor/library/Mobile.cls.xml
rename to cls/kutac/monitor/library/Mobile.cls
index 533cf7a..6e28dba 100644
--- a/cls/kutac/monitor/library/Mobile.cls.xml
+++ b/cls/kutac/monitor/library/Mobile.cls
@@ -1,12 +1,8 @@
-
-
-
-%DeepSee.UserLibrary.Container
-64138,54823.866061
+Class kutac.monitor.library.Mobile Extends %DeepSee.UserLibrary.Container
+{
-
-http://www.intersystems.com/deepsee/library
-
@@ -113,7 +109,7 @@
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/library/Pivots.cls.xml b/cls/kutac/monitor/library/Pivots.cls
similarity index 99%
rename from cls/kutac/monitor/library/Pivots.cls.xml
rename to cls/kutac/monitor/library/Pivots.cls
index 126f335..a6b382f 100644
--- a/cls/kutac/monitor/library/Pivots.cls.xml
+++ b/cls/kutac/monitor/library/Pivots.cls
@@ -1,15 +1,10 @@
-
-
-
-%DeepSee.UserLibrary.Container
-63327,60672.446665
+Class kutac.monitor.library.Pivots Extends %DeepSee.UserLibrary.Container
+{
-
-
-This XData section contains the contents of this container.
-Typically this is an xml document representing a Dashboard or Pivot.
-http://www.intersystems.com/deepsee/library
-
@@ -472,7 +467,7 @@ Typically this is an xml document representing a Dashboard or Pivot.
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/task/Builder.cls.xml b/cls/kutac/monitor/task/Builder.cls
similarity index 57%
rename from cls/kutac/monitor/task/Builder.cls.xml
rename to cls/kutac/monitor/task/Builder.cls
index 2c4475d..e09dd26 100644
--- a/cls/kutac/monitor/task/Builder.cls.xml
+++ b/cls/kutac/monitor/task/Builder.cls
@@ -1,18 +1,13 @@
-
-
-
-%SYS.Task.Definition
-63544,45910.609546
+Class kutac.monitor.task.Builder Extends %SYS.Task.Definition
+{
-
-
-At the scheduled time, the Task Manager creates an instance of this object,
-sets any property values using the stored "settings" for the task, and then
-invokes this method to execute the task.
-In order to execute a real task, override this method in a subclass.]]>
-%Status
-
+/// At the scheduled time, the Task Manager creates an instance of this object,
+/// sets any property values using the stored "settings" for the task, and then
+/// invokes this method to execute the task.
+/// In order to execute a real task, override this method in a subclass.
+Method OnTask() As %Status
+{
s tSC=$$$OK
try {
set cubes("CurrentSysDataDB")=""
@@ -31,14 +26,11 @@ In order to execute a real task, override this method in a subclass.]]>
-
+}
-
-
-d ##class(kutac.monitor.task.Builder).Setup()
-1
-
w !,ex.DisplayString()
}
quit
-]]>
-
-
-
+}
+
+}
+
diff --git a/cls/kutac/monitor/utils/CashLocale.cls.xml b/cls/kutac/monitor/utils/CashLocale.cls
similarity index 70%
rename from cls/kutac/monitor/utils/CashLocale.cls.xml
rename to cls/kutac/monitor/utils/CashLocale.cls
index 17ae7c0..36bab1e 100644
--- a/cls/kutac/monitor/utils/CashLocale.cls.xml
+++ b/cls/kutac/monitor/utils/CashLocale.cls
@@ -1,16 +1,10 @@
-
-
-
-%RegisteredObject
-64138,62393.66068
+Class kutac.monitor.utils.CashLocale Extends %RegisteredObject
+{
-
-SYSMON
-
+Parameter DOMAIN = "SYSMON";
-
-1
-
-
+}
+
+ClassMethod SetLocale() [ CodeMode = objectgenerator ]
+{
+ do ##class(%MessageDictionary).SetSessionLanguage("en")
+}
+
+}
-
-1
-objectgenerator
-
-
-
-
diff --git a/cls/kutac/monitor/utils/Installer.cls b/cls/kutac/monitor/utils/Installer.cls
new file mode 100644
index 0000000..aeb05b1
--- /dev/null
+++ b/cls/kutac/monitor/utils/Installer.cls
@@ -0,0 +1,355 @@
+Class kutac.monitor.utils.Installer
+{
+
+XData Install [ XMLNamespace = INSTALLER ]
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+/// This is a method generator whose code is generated by XGL.
+/// Set pVars("Namespace")="SYSMON"
+/// Set pVars("SourceDir")="C:\temp\SYSMON\cls\kutac\"
+/// do ##class(kutac.monitor.utils.Installer).setup(.pVars)
+ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 0, pInstaller As %Installer.Installer) As %Status [ CodeMode = objectgenerator, Internal ]
+{
+ Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "Install")
+}
+
+ClassMethod EnableDeepSee(pVars, pLogLevel, tInstaller) As %Status
+{
+ set namespace = tInstaller.Evaluate("${Namespace}")
+ 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) {
+ do $system.Status.DisplayError(tSC)
+ quit
+ }
+
+ set tApplication.DeepSeeEnabled = 1
+ set tSC = tApplication.%Save()
+ } catch e {
+ set tSC = e.AsStatus()
+ }
+
+ do $system.Status.DisplayError(tSC)
+ quit tSC
+}
+
+ClassMethod ConfiguringMonitor(pVars, pLogLevel, tInstaller) As %Status
+{
+ set Namespace=tInstaller.Evaluate("${Namespace}")
+
+ do tInstaller.PushNS(Namespace)
+ do $system.OBJ.CompilePackage("kutac.monitor.history,"_
+ "kutac.monitor.kpi,"_
+ "kutac.monitor.current,"_
+ "kutac.monitor.library,"_
+ "kutac.monitor.task,"_
+ "kutac.monitor.utils"_
+ "kutac.REST","cuk")
+
+ do $system.OBJ.CompilePackage("kutac.monitor.cubes","cuk")
+ do tInstaller.PopNS()
+
+ do tInstaller.PushNS("%SYS")
+
+ do ..WriteLog("Activating Monitor Classes")
+ set st2 = ..ActivatingClasses()
+
+ do ..WriteLog("Starting Monitor")
+ set st3 = ..RunningMonitor()
+
+ &sql(select id into :TaskID from %SYS.Task where Name = 'Rebuild SYSMON Cubes')
+ do tInstaller.PopNS()
+
+ do tInstaller.PushNS(Namespace)
+ if +SQLCODE {
+ do ..WriteLog("Creating Task")
+ Do ##class(kutac.monitor.task.Builder).Setup()
+ } else {
+ do ##class(%SYS.Task).Resume(TaskID)
+ do ##class(%SYS.Task).RunNow(TaskID)
+ }
+
+ do tInstaller.PopNS()
+
+ do tInstaller.PushNS("%SYS")
+ set SSLConfig = "EmailDefault"
+ do:'##class(Security.SSLConfigs).Exists(SSLConfig) ##class(Security.SSLConfigs).Create(SSLConfig)
+ do ##class(%Monitor.Manager).AppSmtpServer(,,.SSLConfig)
+ do tInstaller.PopNS()
+
+ set st = $$$ADDSC(st2, st3)
+ if $$$ISERR(st) Throw ##class(%Installer.Exception).CreateFromStatus(st)
+ quit $$$OK
+}
+
+ClassMethod ActivatingClasses() As %Status
+{
+ set act = $LISTBUILD("%Monitor.System.HistoryPerf","%Monitor.System.Diskspace","%Monitor.System.License","%Monitor.System.Processes","%Monitor.System.HistorySys","%Monitor.System.Freespace","%Monitor.System.LockTable","%Monitor.System.Routines")
+ set str = $LISTTOSTRING(act)
+ for i = 1:1:$LISTLENGTH(act)
+ {
+ set cls = $PIECE(str, ",", i)
+ set id = ""
+ do ##class(%Monitor.ItemGroup).MetricsClassItemGroup(cls,.id)
+ s class = ##class(%Monitor.ItemGroup).%OpenId(id)
+ if '$IsObject(class)
+ {
+ do ..WriteLog("ERROR: Class '"_cls_"' does not exist")
+ }
+ else
+ {
+ set class.Activated = 1
+ set status = class.%Save()
+ if ('status)
+ {
+ w $System.Status.GetErrorText(st)
+ }
+ }
+ }
+ return $$$OK
+}
+
+ClassMethod RunningMonitor() As %Status
+{
+ s sc = ##class(%SYS.Monitor).Stop()
+ s sc1 = ##class(%SYS.Monitor).Start()
+ do ..WriteLog("System Monitor has been restarted!")
+ return sc1
+}
+
+ClassMethod OfflineInstall(ByRef pVars, pLogLevel As %Integer = 0, tInstaller As %Installer.Installer) As %Status
+{
+ set ns = $Namespace
+ set namespace = tInstaller.Evaluate("${Namespace}")
+
+ zn namespace
+ do $system.OBJ.ImportDir(tInstaller.Evaluate("${SourceDir}"),"*.xml","ck",.st,1)
+
+ zn ns
+ quit $$$OK
+}
+
+ClassMethod WriteLog(text As %String)
+{
+ w !, text, !
+}
+
+ClassMethod createBrokerApplication(pVars, pLogLevel, tInstaller) As %Status
+{
+ set Namespace = tInstaller.Evaluate("${Namespace}")
+ do tInstaller.PushNS("%SYS")
+ set cspProperties("NameSpace") = Namespace
+ set cspProperties("AutheEnabled") = $$$AutheCache
+ set cspProperties("IsNameSpaceDefault") = $$$NO
+ set cspProperties("DispatchClass") = "kutac.REST.ConfigBroker"
+ set cspProperties("GroupById") = "sysmon"
+ set cspProperties("MatchRoles") = ":%All"
+ set cspProperties("CookiePath") = "/"
+
+ set tSC = ##class(Security.Applications).Create("/sysmon", .cspProperties)
+ if $$$ISERR(tSC) throw ##class(%Installer.Exception).CreateFromStatus(tSC)
+ kill cspProperties, security
+ do tInstaller.PopNS()
+
+ quit $$$OK
+}
+
+ClassMethod CopyClasses(pVars, pLogLevel, tInstaller)
+{
+
+ set sc = $$$OK
+
+ set i = 0
+ while 1 {
+ set id = "SYSMON.CLSData||File" _ i
+ if (##class(%Dictionary.CompiledXData).%ExistsId(id) = 0) Q
+ set class = ##class(%Dictionary.CompiledXData).%OpenId(id)
+ set data = $zconvert(class.Data.Read(class.Data.Size), "O", "UTF8")
+ set className = $piece(class.Description,".",1,*-1)
+
+ set Namespace = tInstaller.Evaluate("${Namespace}")
+ do tInstaller.PushNS(Namespace)
+
+ if ('##class(%Dictionary.ClassDefinition).%ExistsId(className)) {
+ set clsDef = ##class(%Dictionary.ClassDefinition).%New()
+ set clsDef.Name = className
+ set sc = clsDef.%Save()
+ quit:$$$ISERR(sc)
+ }
+
+ set sc = ##class(%Compiler.UDL.TextServices).SetTextFromString(,className,$System.Encryption.Base64Decode(data))
+
+ do tInstaller.PopNS()
+
+ set i = i + 1
+ }
+
+ quit sc
+}
+
+ClassMethod CopyDFI(pVars, pLogLevel, tInstaller)
+{
+ set sc = $$$OK
+
+ set i = 0
+ while 1 {
+ set id = "SYSMON.DFIData||File" _ i
+ if (##class(%Dictionary.CompiledXData).%ExistsId(id) = 0) Q
+ set dfi = ##class(%Dictionary.CompiledXData).%OpenId(id)
+
+ set data = ##class(%GlobalCharacterStream).%New()
+ do data.Clear()
+ do data.Write($zconvert(dfi.Data.Read(dfi.Data.Size), "O", "UTF8"))
+
+ set dfiName = $piece(dfi.Description,".",1)
+
+ set Namespace = tInstaller.Evaluate("${Namespace}")
+ do tInstaller.PushNS(Namespace)
+
+ if '##class(%DeepSee.UI.FolderItemDocument).%ExistsId(dfiName) {
+ try {
+ set tDoc = ##class(%DeepSee.UI.FolderItemDocument).%New(dfiName)
+ set sc = tDoc.ImportFromXML(data)
+
+ set sc = tDoc.Save()
+ do tInstaller.Log(pLogLevel, "Creating DFI", dfiName)
+ } Catch e {
+ set sc = e.AsStatus()
+ }
+ } else {
+ try {
+ set tDoc = ##class(%DeepSee.UI.FolderItemDocument).%OpenId(dfiName)
+ set sc = tDoc.ImportFromXML(data)
+
+ set sc = tDoc.Save()
+ do tInstaller.Log(pLogLevel, "Creating DFI", dfiName)
+ } Catch e {
+ set sc = e.AsStatus()
+ }
+ }
+
+ do tInstaller.PopNS()
+
+ set i = i + 1
+ }
+
+ quit $$$OK
+}
+
+ClassMethod CopyFiles(pVars, pLogLevel, tInstaller)
+{
+ set csp = tInstaller.Evaluate("${CSPDIR}")
+ set appdir = tInstaller.Evaluate("${Namespace}")
+ set path = ##class(%File).NormalizeDirectory(csp _ appdir)
+
+ // Get path separator
+ set r = ##class(%File).NormalizeDirectory("\")
+ if ($find(r, "/") = 0) {
+ set r = "\"
+ } else {
+ set r = "/"
+ }
+
+ set i = 0
+ while 1 {
+ set id = "SYSMON.CSPData||File" _ i
+ if (##class(%Dictionary.CompiledXData).%ExistsId(id) = 0) Q
+ set file = ##class(%Dictionary.CompiledXData).%OpenId(id)
+
+ set data = $zconvert(file.Data.Read(file.Data.Size), "O", "UTF8")
+ set fileName = ##class(%File).NormalizeFilename(path _ file.Description)
+
+
+ set fileName = $replace(fileName, "\", r)
+ set fileName = $replace(fileName, "/", r)
+ set dir = ##class(%File).ParentDirectoryName(fileName)
+ if ('##class(%File).DirectoryExists(dir)) {
+ do ##class(%File).CreateDirectory(dir)
+ }
+
+ do tInstaller.Log(pLogLevel, "Creating file", fileName)
+
+
+ set f = ##class(%Stream.FileBinary).%New()
+ do f.LinkToFile(fileName)
+ do f.Write($System.Encryption.Base64Decode(data))
+ do f.%Save()
+
+ set i = i + 1
+ }
+
+ quit $$$OK
+}
+
+}
+
diff --git a/cls/kutac/monitor/utils/Installer.cls.xml b/cls/kutac/monitor/utils/Installer.cls.xml
deleted file mode 100644
index 97ee140..0000000
--- a/cls/kutac/monitor/utils/Installer.cls.xml
+++ /dev/null
@@ -1,667 +0,0 @@
-
-
-
-63732,50627.865496
-
-
-INSTALLER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
- This is a method generator whose code is generated by XGL.
-Set pVars("Namespace")="SYSMON"
-Set pVars("SourceDir")="C:\temp\SYSMON\cls\kutac\"
-do ##class(kutac.monitor.utils.Installer).setup(.pVars)
-1
-1
-objectgenerator
-
-%Status
-
-
-
-
-1
-pVars,pLogLevel,tInstaller
-%Status
-
-
-
-
-1
-pVars,pLogLevel,tInstaller
-%Status
-
-
-
-
-1
-Namespace=$Namespace,Owner:%String="intersystems-ru",Repository:%String="deepsee-sysmon-dashboards",Branch:%String,Username:%String,Password:%String
-%Status
-
-
-
-
-1
-
-%Status
-
-
-
-
-1
-File:%ZEN.proxyObject
-%Boolean
-
-
-
-
-1
-Links:%ListOfDataTypes,Request:%Net.HttpRequest,*Items
-%Status
-
-
-
-
-1
-contentStream:%GlobalCharacterStream,url:%String
-%Boolean
-
-
-
-
-
-
-
-
-1
-contentStream:%CacheString,url:%String,CSPDirInRepo:%String="csp/"
-%Status
-
-
-
-
-1
-contentStream:%GlobalCharacterStream,url:%String
-%Boolean
-
-
-
-
-1
-contentStream:%GlobalCharacterStream,url:%String
-%Status
-
-
-
-
-1
-url:%String
-%String
-
-
-
-
-1
-contentStream:%CharacterStream,url:%String
-%Status
-
-
-
-
-1
-
-%Status
-
-
-
-
-1
-className:%String
-%Boolean
- 0) {
- Return 1
- }
- Return 0
-]]>
-
-
-
-1
-contentStream:%CharacterStream,url:%String
-%Status
-
-
-
-
-1
-
-%Status
-
-
-
-
-1
-contentStream:%GlobalCharacterStream,url:%String
-%Status
-
-
-
-
-1
-pVars,pLogLevel,tInstaller
-%Status
-
-
-
-
-1
-%Status
-
-
-
-
-1
-%Status
-
-
-
-
-1
-
-%Status
-
-
-
-
-1
-pVars,pLogLevel,tInstaller
-%Status
-
-
-
-
-1
-text:%String
-
-
-
-
-1
-pVars,pLogLevel,tInstaller
-%Status
-
-
-
-
-text/plain
-
-
-
-
diff --git a/csp-data/csp/index.html.xml b/csp-data/csp/index.html
similarity index 81%
rename from csp-data/csp/index.html.xml
rename to csp-data/csp/index.html
index 2d176a4..69cb50e 100644
--- a/csp-data/csp/index.html.xml
+++ b/csp-data/csp/index.html
@@ -1,6 +1,3 @@
-
-
-
@@ -19,17 +16,16 @@
-
+
-
+
-]]>
-
+