Tempanzeige Serverräume
This commit is contained in:
@@ -269,20 +269,28 @@ Public Class cExtProgramme
|
||||
If Username.Length > 0 And Password.Length > 0 Then
|
||||
AnmeldeDatenVorhanden = True
|
||||
commandcmd("cmdkey /generic:" & host & " /user:" & Username & " /pass:" & Password)
|
||||
Threading.Thread.Sleep(3000)
|
||||
Threading.Thread.Sleep(2000)
|
||||
End If
|
||||
|
||||
Dim rdpfile As String = RDPFileErstellen(host)
|
||||
''1 RDP Datei erstellen
|
||||
'Dim rdpfile As String = RDPFileErstellen(host)
|
||||
|
||||
'mstsc.StartInfo.FileName = "mstsc.exe"
|
||||
'mstsc.StartInfo.UseShellExecute = False
|
||||
''mstsc.StartInfo.Arguments = " /v: " & host & rdpASadmin & FensterString
|
||||
'mstsc.StartInfo.Arguments = " " & rdpfile
|
||||
|
||||
'2 direkt verbinden
|
||||
|
||||
mstsc.StartInfo.FileName = "mstsc.exe"
|
||||
mstsc.StartInfo.UseShellExecute = False
|
||||
'mstsc.StartInfo.Arguments = " /v: " & host & rdpASadmin & FensterString
|
||||
mstsc.StartInfo.Arguments = " " & rdpfile
|
||||
mstsc.StartInfo.Arguments = " /v: " & host & rdpASadmin & FensterString
|
||||
|
||||
|
||||
mstsc.Start()
|
||||
|
||||
If AnmeldeDatenVorhanden = True Then
|
||||
Threading.Thread.Sleep(3000)
|
||||
Threading.Thread.Sleep(5000)
|
||||
|
||||
Dim Abmeldung As New Process
|
||||
commandcmd("cmdkey /delete:" & host)
|
||||
@@ -310,6 +318,7 @@ desktopheight:i:1080
|
||||
session bpp:i:32
|
||||
winposstr:s:0,1,-2219,191,-283,1310
|
||||
compression:i:1
|
||||
prompt for credentials:i:0
|
||||
keyboardhook:i:1
|
||||
audiocapturemode:i:0
|
||||
videoplaybackmode:i:1
|
||||
|
||||
45
Dokumentation/Classes/cPRTG.vb
Normal file
45
Dokumentation/Classes/cPRTG.vb
Normal file
@@ -0,0 +1,45 @@
|
||||
Imports System.Net
|
||||
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Public Class cPRTG
|
||||
|
||||
|
||||
|
||||
Public Async Function getValuefromPRTG(sensorId As String, kanalnummer As Integer) As Task(Of String)
|
||||
Dim prtgServer As String = "https://management01.verag.ost.dmn"
|
||||
'Dim sensorId As String = "8223"
|
||||
Dim username As String = "admin"
|
||||
Dim passhash As String = "1828632597"
|
||||
'Dim kanalnummer As Integer = 8
|
||||
|
||||
Dim url As String = $"{prtgServer}/api/table.json?content=channels&columns=objid,name,lastvalue&id={sensorId}&username={username}&passhash={passhash}"
|
||||
|
||||
|
||||
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
|
||||
ServicePointManager.ServerCertificateValidationCallback = Function(sender, cert, chain, sslPolicyErrors) True
|
||||
|
||||
Try
|
||||
Using client As New WebClient()
|
||||
client.Encoding = System.Text.Encoding.UTF8
|
||||
Dim jsonText As String = Await client.DownloadStringTaskAsync(url)
|
||||
|
||||
Dim json As JObject = JObject.Parse(jsonText)
|
||||
Dim channels = json("channels")
|
||||
|
||||
If TypeOf channels Is JArray AndAlso kanalnummer >= 0 AndAlso kanalnummer < channels.Count Then
|
||||
Dim channel = channels(kanalnummer)
|
||||
Dim name = channel("name").ToString()
|
||||
Dim value = channel("lastvalue").ToString().Replace("Â", "").Trim()
|
||||
Return $"{value}"
|
||||
Else
|
||||
Return $"Kanal {kanalnummer} ungültig oder nicht vorhanden."
|
||||
End If
|
||||
End Using
|
||||
|
||||
Catch ex As Exception
|
||||
Return "Fehler: " & ex.Message
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user