cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aplrich
Engaged Sweeper III
I want to scan specific servers for a specific event log entry. We have 4 backup servers, I want to scan for the latest success or failure event log entry listed for each one.

Is there any way to do this?

In my mind, i'd have a report I display on our main dashboard that lists the 4 servers and the most recent event log entry by our backup software so we can see the success or failure of the most recent backup.
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
A sample report can be seen below. It lists the last success or failure audit event(s) scanned for each of your servers. Note that:
- It is possible for multiple events to be scanned at the same time, so there may be multiple entries per server.
- Lansweeper only scans errors by default. Additional event types can be enabled for scanning in the Lansweeper web console under Configuration/Scanning Setup/Server Options.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysOS.Image As icon,
tblNtlog.Eventcode,
Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' When 4 Then 'Success Audit'
When 5 Then 'Failure Audit' End As Eventtype,
tblNtlogFile.Logfile,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message,
tblNtlogUser.Loguser,
tblNtlog.TimeGenerated
From tblAssets
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogFile On tblNtlogFile.LogfileID = tblNtlog.LogfileID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogUser On tblNtlogUser.LoguserID = tblNtlog.LoguserID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join (Select Top 1000000 tblNtlog.AssetID,
Max(tblNtlog.TimeGenerated) As LastEvent
From tblNtlog
Where Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' When 4 Then 'Success Audit'
When 5 Then 'Failure Audit'
End = 'success audit' Or Case tblNtlog.Eventtype When 1 Then 'Error'
When 2 Then 'Warning' When 3 Then 'Information'
When 4 Then 'Success Audit' When 5 Then 'Failure Audit' End = 'failure audit'
Group By tblNtlog.AssetID) SubQuery1 On SubQuery1.LastEvent =
tblNtlog.TimeGenerated And SubQuery1.AssetID = tblAssets.AssetID
Where tblComputersystem.Domainrole > 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblNtlogFile.Logfile,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message

View solution in original post

1 REPLY 1
Hemoco
Lansweeper Alumni
A sample report can be seen below. It lists the last success or failure audit event(s) scanned for each of your servers. Note that:
- It is possible for multiple events to be scanned at the same time, so there may be multiple entries per server.
- Lansweeper only scans errors by default. Additional event types can be enabled for scanning in the Lansweeper web console under Configuration/Scanning Setup/Server Options.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysOS.Image As icon,
tblNtlog.Eventcode,
Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' When 4 Then 'Success Audit'
When 5 Then 'Failure Audit' End As Eventtype,
tblNtlogFile.Logfile,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message,
tblNtlogUser.Loguser,
tblNtlog.TimeGenerated
From tblAssets
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogFile On tblNtlogFile.LogfileID = tblNtlog.LogfileID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogUser On tblNtlogUser.LoguserID = tblNtlog.LoguserID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join (Select Top 1000000 tblNtlog.AssetID,
Max(tblNtlog.TimeGenerated) As LastEvent
From tblNtlog
Where Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' When 4 Then 'Success Audit'
When 5 Then 'Failure Audit'
End = 'success audit' Or Case tblNtlog.Eventtype When 1 Then 'Error'
When 2 Then 'Warning' When 3 Then 'Information'
When 4 Then 'Success Audit' When 5 Then 'Failure Audit' End = 'failure audit'
Group By tblNtlog.AssetID) SubQuery1 On SubQuery1.LastEvent =
tblNtlog.TimeGenerated And SubQuery1.AssetID = tblAssets.AssetID
Where tblComputersystem.Domainrole > 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblNtlogFile.Logfile,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message