NAME: FilesizeMonitor.vbs
Parameters - File_name (need to specify the Path and the file Name)and FileSize_Threshold (File size in KB)
Create New Event Rule to Monitor the Event ID 4444 for File Threshold Exceed and Event 4441 for File Not found Error.
'*****************************************************************
Option Explicit
Dim filesize, fs, file
Dim Filename, FileSizeThreshold
Dim objEvt, objParameters
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16
On Error Resume next
Set objParameters = ScriptContext.Parameters
Filename = objParameters.get("File_name")
FileSizeThreshold = objParameters.get("FileSize_Threshold")
Set fs=CreateObject("Scripting.FileSystemObject")
Set file=fs.GetFile(Filename)
If Err.Number > 0 Then
Set objEvt = ScriptContext.CreateEvent
objEvt.Message = "Cannot find the file " & Filename & " on the server " & objEvt.LoggingComputer
objEvt.EventSource = "FileSizeMonitor"
objEvt.EventType = EVENT_TYPE_ERROR
objEvt.EventNumber = 4441
ScriptContext.Submit(objEvt)
ScriptContext.Quit
Else
filesize = file.Size / 1024
Else
filesize = file.Size / 1024
if filesize <>
Set objEvt = ScriptContext.CreateEvent
objEvt.Message = "The File " & Filename & " on " & objEvt.LoggingComputer & " is less then the specified threshold (threshold =" & FileSizeThreshold & ")"
objEvt.EventSource = "FileSizeMonitor"
objEvt.EventType = EVENT_TYPE_ERROR
objEvt.EventNumber = 4444
ScriptContext.Submit(objEvt)
ScriptContext.Quit
End If
End if
End if
4 comments:
Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!
singles dances massachusetts [url=http://loveepicentre.com/]singles wanting family[/url] croatian chicago singles http://loveepicentre.com/ chicago dating interracial
drug impact [url=http://usadrugstoretoday.com/products/cipro.htm]cipro[/url] dental rubber bands http://usadrugstoretoday.com/products/study-habits.htm medical billing employment http://usadrugstoretoday.com/products/cefixime.htm
lupus renal insufficiency muscle breakdown [url=http://usadrugstoretoday.com/categories/perte-de-poids.htm]perte de poids[/url] drug tests and their accuracy [url=http://usadrugstoretoday.com/products/epivir.htm]art breast plates[/url]
Post a Comment