139 |
|
Dim seqNo As Long |
140 |
|
Dim machineName As String |
141 |
|
|
142 |
+ |
Dim secondsRunning As Long |
143 |
+ |
|
144 |
|
Dim filterHostname As String |
145 |
|
Dim filterTCPPort As Integer |
146 |
|
Dim filterUDPPort As Integer |
147 |
|
Dim fileList As String |
148 |
|
Dim lastModified As String |
149 |
|
|
150 |
+ |
Dim fourtySevenDays As Integer |
151 |
+ |
|
152 |
|
Dim UDPUpdateTime As Integer |
153 |
|
Dim TCPUpdateTime As Integer |
154 |
|
|
183 |
|
End |
184 |
|
End If |
185 |
|
|
186 |
+ |
' Assume the host is run within the first 47 days of the machine starting. |
187 |
+ |
fourtySevenDays = 0 |
188 |
+ |
|
189 |
|
protocolVersion = "1.1" |
190 |
|
|
191 |
|
Status.Caption = "Loading" |
395 |
|
Exit Sub |
396 |
|
|
397 |
|
configError: |
398 |
< |
Status.Caption = "FAILED to get configuration" |
398 |
> |
Status.Caption = "FAILED to get configuration from the server" |
399 |
|
Exit Sub |
400 |
|
heartbeatError: |
401 |
|
Status.Caption = "Heatbeat FAILED" |
414 |
|
' prepare the contents of the XML packet. |
415 |
|
seqNo = seqNo + 1 |
416 |
|
|
417 |
< |
' Comment this line in the next protocol |
411 |
< |
'machineName = TCPSock.LocalHostName |
417 |
> |
netbiosName = TCPSock.LocalHostName |
418 |
|
|
419 |
|
LocalIP = TCPSock.LocalIP |
420 |
|
packetDate = Date2Num() |
462 |
|
memory& = memsts.dwAvailVirtual |
463 |
|
swapFree = memory& \ 1048576 |
464 |
|
|
459 |
– |
uptime = CUpTime.MilliSecs \ 1000 |
460 |
– |
|
465 |
|
CUpTime.Capture |
466 |
|
cpu_time = CUpTime.CPUTime |
467 |
|
percent_idle = CUpTime.PercentIdle |
468 |
|
|
469 |
+ |
'' Doesn't work after 47 days :-/ |
470 |
+ |
'uptime = GetTickCount \ 1000 |
471 |
+ |
|
472 |
+ |
'secondsRunning = secondsRunning + UDPUpdateTime |
473 |
+ |
'uptime = secondsRunning |
474 |
+ |
|
475 |
+ |
uptime = CUpTime.MilliSecs / 1000# |
476 |
+ |
|
477 |
|
userCount = wksta.LoggedOnUsers |
478 |
|
|
479 |
|
' build the contents of the XML packet |
480 |
|
xml = "<packet seq_no=""" & seqNo & """ machine_name=""" & machineName & """ date=""" & packetDate & """ type=""data"" ip=""" & LocalIP & """>" & _ |
481 |
|
"<os>" & _ |
482 |
+ |
"<netbios_name>" & netbiosName & "</netbios_name>" & _ |
483 |
|
"<name>" & osName & "</name>" & _ |
484 |
|
"<version>" & osVersionMajor & "</version>" & _ |
485 |
|
"<release>" & osBuild & "</release>" & _ |