Lab 4 Modifying the Ping Script

In this lab, you will modify the ping script so that it can be used to monitor your servers.

Lab Instructions

  1. Open lab3.vbs and save it as lab4.vbs. (You can also use pingsolution.vbs if you change strMachines = "s1;s2" to your local servers.)

  2. Comment out On Error Resume Next so that you can test the script.

  3. Define a constant called ONE_HOUR and set it equal to 100 for testing purposes. In the real world, 3600000 is equal to 1 hour for the WScript.Sleep command.

  4. Declare a variable to be used to count to 8, such as ihours.

  5. Add a For ihours = 1 To 8 command to the beginning of the Worker section. It will go under aMachines = Split(strMachines, ";").

  6. Add the WScript.Sleep(ONE_HOUR) command to the bottom of the script (after ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.