- VERSION 4.11.30

- Se quitaron librerias y permisos que no se usaban.
- Se agregó la opción de monitorear mas de un servidor.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-12-01 02:28:38 -06:00
parent 4fe5dbd25a
commit 80d6ded85e
8 changed files with 243 additions and 80 deletions

View File

@@ -43,9 +43,26 @@ Sub Service_Start (StartingIntent As Intent)
s.Initialize
skmt = s.inicializaBD(File.DirInternal, "kmt.db")
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS cat_variables(nombre TEXT, valor text)")
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS cat_servidores(id INTEGER PRIMARY KEY, nombre TEXT, url text, intervalo TEXT, timeout TEXT)")
skmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS error_log(error TEXT, fecha text)")
If s.traeDBReqServerDeBD <> "N/A" Then DBReqServer = s.traeDBReqServerDeBD
' reqManager.Initialize(Me, DBReqServer)
Private sa As Cursor = skmt.ExecQuery("select count(*) as cuantos from cat_servidores")
sa.Position = 0
If sa.GetString("cuantos") = 0 Then
Private sa2 As Cursor = skmt.ExecQuery("select * from cat_variables where nombre = 'servidor'")
If sa2.RowCount > 0 Then
sa2.Position = 0
skmt.ExecNonQuery($"insert into cat_servidores (url, intervalo, timeout) values ('${sa2.GetString("valor")}', '30', '11000')"$)
End If
End If
Private sa As Cursor = skmt.ExecQuery("select count(*) as cuantos from cat_servidores")
sa.Position = 0
If sa.GetString("cuantos") = 0 Then
skmt.ExecNonQuery($"insert into cat_servidores (url, intervalo, timeout) values ('http://keymon.lat:1781', '30', '11000')"$)
End If
StartService(Monitor)
End Sub
'