Groovy script to discover all Foglight Management Server (FMS) Blackouts.
Also included is a groovy script to delete FMS blackouts
From FMS host command line (fglcmd) or Dashboards| Administration| Tooling | Script Console| Scripts Tab | Add
Note: Scripts could take a long time to run in larger environments and may be best to run from command line.
List all Blackout(s) (Groovy)
topsvc = server.get("TopologyService");
objs = #! TopologyObject #.getTopologyObjects();
msg = new StringBuilder();
for (obj in objs){
if (obj.isBlackedOut){
name = obj.get("longName");
msg.append(name);
msg.append(" is Blackedout");
msg.append(" \n");
}
}
return msg;
Note: A groovy file via notepad or vi. Copy and paste the script above into the file and save as filename.groovy
Delete all Blackout(s) (Groovy)
topsvc = server.get("TopologyService");
blkSvc = server.get("TopologyBlackoutService");
objs = #! TopologyObject #.getTopologyObjects();
for (obj in objs){
blkOut = blkSvc.getTopologyBlackout(obj.getUniqueId());
blkOut.clearAllSchedules();
}
Note: A groovy file via notepad or vi. Copy and paste the script above into the file and save as filename.groovy