SCHEDULE SCAN ENABLE
From TDiWiki
This script is designed to enable scanning for a Console or Group of Consoles based on a Scheduled Event. The script must be run on an Event Automatic Action. The Scheduled Event will determine the Console or Group that is affected. The script run by the Automatic Action associated to the Scheduled Event.
Contents |
[edit] Script Properties
Name: SCHEDULE_SCAN_ENABLE
Description: This script will enable scanning for a console based on a scheduled event.
Profile: CONSOLE_MANAGER
Timeout: 30 (seconds)
[edit] Run Type
Run as Event Automatic Action
[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: 6/16/2011 *
if (action.type == "NEW"){
var consoleName;
var myEvtOcc;
evtOccName = action[action.type]; // get the name of the event occurence that triggered the script
consoleName = action.console;
myConsole = Console.get(consoleName);
myEvtOcc = EventOccurrence.get(evtOccName);
log("CONWRKS", "Script run from the " + evtOccName + " EventOccurence.");
log("CONWRKS", "console name = " + consoleName);
if (myConsole.scandisabled == "Y") {
log("CONWRKS","Scanning enabled on Console "+consoleName+" as a part of scheduled maintenance window.");
myConsole.scandisabled = "N";
myConsole.save();
}
var cmt={ackcmt:"Scheduled maintenance window."};
myEvtOcc.cancel(cmt);
}else{
log("CONWRKS", "This is script is intended to be run as an Automatic Action.");
}
[edit] Related Resources
In order to run this script, you will need to create an event with an Automatic Action and a schedule to trigger it. You will not need to specify a pattern or a scan.
The Automatic Action should look like this:
Type: CWScript When this Event occurs on <specify Console or Group here> run SCHEDULE_SCAN_ENABLE with parameter of ___ during <specify Time-Frame here> Time-Frame and a contact of ___
The Scheduled Event should look like this:
Frequency: <choose Once or Repeat> Trigger this Event on the <choose Console or Group> <select specific Console or Group> at <specify date/time here> with a context note of <add optional comment here>
