Vb .net 2008
I am building an application to put any warning or errors in the event file into a table. I have one table with all the server and users machine name. I also am putting what areas in the Event log I want. ( application – security – system) I have a table where I will add any non informational errors/warning to.
My questions are
How can I tell a server/computer is up and running? How can I tell I successfully read a record in the say application area in my event log? I mean right now I can read thought the event logs and get the transactions and log them but I have no status checking to say oh yes my server ‘abc’ is up and running.
I read though and get a table of all machines up and responding now.(old way see code )
Public Function GetNetworkComputers() As ArrayList
Dim networkComputers As New ArrayList()
Const MAX_PREFERRED_LENGTH As Integer = -1
Dim SV_TYPE_WORKSTATION As Integer = 1
Dim SV_TYPE_SERVER As Integer = 2
Dim buffer As IntPtr = IntPtr.Zero
Dim tmpBuffer As IntPtr = IntPtr.Zero
Dim entriesRead As Integer = 0
Dim totalEntries As Integer = 0
Dim resHandle As Integer = 0
Dim sizeofINFO As Integer = Marshal.SizeOf(GetType(_SERVER_INFO_100))
Dim ret As Integer = NetServerEnum(Nothing, 100, buffer, MAX_PREFERRED_LENGTH, entriesRead, totalEntries, _
SV_TYPE_WORKSTATION Or SV_TYPE_SERVER, Nothing, resHandle)
If ret = 0 Then
For i As Integer = 0 To totalEntries
tmpBuffer = New IntPtr(CType(buffer, Integer) + (i * sizeofINFO))
Dim svrInfo As _SERVER_INFO_100 = CType(Marshal.PtrToStructure(tmpBuffer, _
- But even now once they are in my array it doesn’t mean by the time I go to read then they are they still up and running? I guess also I am also asking for the way I am doing it now can I do a check and see if a machine is still up and responding Which probably is the same answer I need for above.