GROUP ENABLE

From TDiWiki

Jump to: navigation, search

This script is designed to enable all of the Consoles that belong to a Group. This script could be particularly useful for closing a maintenance window for certain devices on your system. Any Consoles that are a part of the Group that were already disabled before the maintenance window will remain disabled.

[edit] Script Properties

Name: GROUP_ENABLE
Description: This script will enable all of the consoles contained in a group.
Profile: CONSOLE_MANAGER
Timeout: 30 (seconds)

[edit] Run Type

Run on Groups

[edit] Script Text

// * Copyright 1999-2011 TDi Technologies, Inc. All rights reserved. *
// * The information in this software is subject to change without   *
// * notice and should not be construed as a commitment by TDi.      *
// * Created: 3/31/2011                                              *

if (action.type != "Group") {
  log("CONWRKS", "This script is intended to be run only on groups!");    // this script is intended to be run only on groups
} else {
  var groupName;
  var myGroup;
  var groupCons;
 
  groupName = action[action.type];     // get the name of the group the script was run on
  myGroup =Group.get(groupName);
  log("CONWRKS", "Script run from the " + groupName + " group.");

  // get the consoles that are a part of the group
  groupCons = myGroup.getConsoles();
  for (console in groupCons)
  {
    log("CONWRKS", "Enable the console: " + groupCons[console].name);
    if (groupCons[console].isDisabled() && groupCons[console].statustext == "Disabled as part of "+groupName+" group") {
      groupCons[console].enable();
    }
  }
}

back to CWScript_-_New_for_ConsoleWorks_4.5

Personal tools