Home » Microsoft Operations Manager 2005 » Monitor if a share is accessible

Monitor if a share is accessible

This script will check if a file in a share is accessible, if not, it will generate a local event.

strFile = "\\ntlcs\share\file_check.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then

Else
   Const EVENT_WARNING = 2
    Set objShell = CreateObject("Wscript.Shell")
    objShell.LogEvent 2, strFile & " is not accessible."
End If

  1. Create a new script and paste the script
  2. Create a new event rule to run the script every X minute as respond
  3. Create a new event rule to collect event ID 2 and event type of Warning
  4. Commit configuration change