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.
myadmin:mypassword
: the username and password of a user with blackout rights."https://servicemanager:18443/rest"
: the url and port number of the service manager."command=blackout"
: establishes the context for setting the state."server_name=servername:3306"
: Specify the server to black out using the name that appears in the Server Tree, including the colon and port number."blackout_state=true"
: sets the blackout state of the selected server. The selected server is grayed-out in the dashboard.
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"
.
Restarting MySQL Enterprise Monitor does not reactivate a blacked out server.