Here are instructions to set up a Windows Power shell data collector to monitoring the state a mounted network drive.

    1. In your Dotcom-Monitor Account, set up a MetricsView Custom Collector:
    2. Setup a Custom Metrics device. Select the Collector created at the pervious step. Set the Aggregate type to Minimum or Maximum.   
      There could be 2 states for the mounted network drive. States are transformed into values:
      Network drive is not accessible – default 0
      Network drive is accessible – default 1000
      We recommend using Minimum, so you can set your Minimum threshold to any value less than 1000 to detect the “Network drive is not accessible” event. Leave the remaining fields at their default values.
    3. To receive the script, create a Trouble Ticket from within your account.
    4. Open Powershell as administrator
    5. Navigate to the directory where ServiceMonitoring.ps1 is installed, for example: cd c:\ps\
    6. Run the command: set-executionpolicy remotesigned
    7. Run the command: .\NetworkMonitoring.ps1 -collector <Collector ID>-task <Task UID> -network <Network share name>  -log
    8. The Collector ID is found under Configure MetricsView Collectors.  
    9. The Task UID is found in the device URL when editing the task.
    10. The Service Name parameter is spelled exactly as it shows up in the services window.
    1. With the –log command you can verify the script was working correctly in the event viewer:WindowsLog
    2. Set up the script to run periodically through Windows Task Scheduler or any other tool you use to run scripts.


    Additional Information about the Script.

    To get built-in help execute .\NetworkMonitoring.ps1

    -log key enables logging to EventLog “Windows Logs/Application”. By default the logging is done to console only.

    There are 2 possible states of the network drive. By default they are transformed into values:

      1. Network drive is not accessible – default 0
        Network drive is accessible – default 1000

    These values can be set to any other values using command-line keys:

    -success <number>

    -error <number>