Documentation Home
MySQL Enterprise Monitor 8.0 Manual
Related Documentation Download this Manual
PDF (US Ltr) - 6.0Mb
PDF (A4) - 6.0Mb

6.5.2 Starting/Stopping the Agent on macOS

Using launchd

The preferred method is to use launchd to load the Agent as a service. After selecting "Install as a service" during the installation process, you may start or stop the Agent service using the following commands.

To start the Agent:

$> sudo launchctl load /Library/LaunchDaemons/mysql.agent.plist

To stop the Agent:

$> sudo launchctl unload /Library/LaunchDaemons/mysql.agent.plist

Using init

Alternatively, an init.d script to start the Agent on macOS is located in the /Applications/mysql/enterprise/agent/etc/init.d directory. To start the Agent navigate to this directory and at the command line type:

$> ./mysql-monitor-agent start

To stop the Agent, use the stop command:

$> ./mysql-monitor-agent stop

If the agent cannot be stopped because the pid file that contains the agent's process ID cannot be found, you can use kill to send a TERM signal to the running process:

$> kill -TERM PID

If you run more than one agent on a specific machine, you must also specify the path to the ini file when you stop the agent. Executing mysql-monitor-agent stop without an ini file only stops the agent associated with the default ini file.

To verify that the agent is running, use the following command:

$> ./mysql-monitor-agent status

The resulting message indicates whether the agent is running. If the agent is not running, use the following command to view the last ten entries in the general Agent log file:

$> tail /Applications/mysql/enterprise/agent/logs/mysql-monitor-agent.log

For further information on troubleshooting the agent, see Section 6.10, “Troubleshooting the Agent”.

Installation creates the directory /Applications/mysql/enterprise/agent, and the logs directory is located immediately below the agent directory.

To see all the command-line options available when running the monitor agent, navigate to the /Applications/mysql/enterprise/agent/etc/init.d directory and execute mysql-monitor-agent help, which displays the usage message:

$> ./mysql-monitor-agent {start|stop|restart|status}

To report its findings, the agent connects to the Monitor UI through the port specified during installation. The default value for this port is 18443; ensure that this port is not blocked. To troubleshoot the agent installation, see Section 6.10, “Troubleshooting the Agent”.