Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Wed Apr 17, 2024 4:56 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Failed Audits
PostPosted: Sat Oct 06, 2007 7:05 am 
Offline
Newbie

Joined: Sat Nov 12, 2005 4:56 am
Posts: 10
The failed audit file is being overwritten each time audit.vbs is run, regardless of whether it's in the middle of a local domain/input file loop. I made the modification below to fix the problem. The only issue with my idea is that if you truly are only auditing a single machine then the failed_audits.txt file is not cleared. Maybe someone has a more elegant solution? Also, this file only catches audits that fail due to the computer not being reachable (IsConnectible()). Is there a way we get logging for other reasons? One other thing I noticed while debuging was that the possibility exists that two simultaneous audit.vbs processes could open/append to this file at the same time. For instance, if two consecutive computers are unreachable. I'm not sure what the best way to fix this is. Maybe putting the failure code in the main audit.vbs run, and child processes could exit with various errorlevels to indicate there was a problem?

I CHANGED:
[code]Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("failed_audits.txt") and (strComputer = "") Then
Set objFile = objFSO.OpenTextFile("failed_audits.txt", 2)
objFile.WriteLine
objFile.Close
Else
Set objFile = objFSO.CreateTextFile("failed_audits.txt", 2)
objFile.WriteLine
objFile.Close
End If[/code]

TO:
[code]If strComputer = "" then
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("failed_audits.txt") and (strComputer = "") Then
Set objFile = objFSO.OpenTextFile("failed_audits.txt", 2)
objFile.WriteLine
objFile.Close
Else
Set objFile = objFSO.CreateTextFile("failed_audits.txt", 2)
objFile.WriteLine
objFile.Close
End If
End If[/code]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group