MySQL Enterprise Monitor 3.3.9 Manual

28.3.1 Scripting Blackouts

You can write a script to black out a server, rather than opening a web browser and typing entries into the address bar. This section documents a sample blackout script that can be run from the command line.

Create the following file and save it as blackout.sh or blackout.bat depending on your platform.

  curl -G -k --user myadmin:mypassword "https://servicemanager:18443/rest" 
  --data-urlencode "command=blackout" --data-urlencode "server_name=servername:3306" 
  --data-urlencode "blackout_state=true"

On Unix systems, use the chmod +x blackout.sh command to make the file executable.

To confirm that a server is blacked out, check that its name is grayed-out in the Monitor UI. To end the blackout, run the same script, changing the final argument to "blackout_state=false".

Note

Restarting MySQL Enterprise Monitor does not reactivate a blacked out server.