Starting/Stopping the Agent on Unix

When installation is finished, you can start the monitor agent from the command line by typing:

shell> /opt/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start

For a non-root installation the command would be:

shell> /home/<user name>/mysql/enterprise/agent/etc/init.d/mysql-monitor-agent start

To stop the agent, use the stop command:

shell> ./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:

shell> 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. Likewise, when checking the status of an agent, specify its ini file.

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

shell> ./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 agent log file:

shell> tail /opt/mysql/enterprise/agent/log/mysql-monitor-agent.log

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

Installation creates the directory /opt/mysql/enterprise/agent with the settings stored in the mysql-monitor-agent.ini file located directly below this directory in the etc directory. The log directory is also located immediately below the agent directory.

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

Usage: ./mysql-monitor-agent {start|stop|restart|status} [ini-file-name]

The ini-file-name option only needs to be used if the ini file is not installed to the default location or you have changed the name of the ini file. You will need to use this option if you are installing more than one agent on the same machine. Pass the full path to the ini file. For example, after navigating to the /opt/mysql/enterprise/agent/etc/init.d directory, issue the command:

shell> ./mysql-monitor-agent start /opt/mysql/enterprise/agent/etc/new-mysql-monitor-agent.ini

If you installed the agent as root, on reboot the mysql-monitor-agent daemon starts up automatically. If you installed the agent as an unprivileged user, you must manually start the agent on reboot or write a script to perform this task. Likewise, if you added an additional agent as described in Section C.2.2, “MySQL Server (agent-instance.ini) Configuration”, to start this agent on reboot, create a system initialization script appropriate to your operating system. To determine whether the agent is running, navigate to the init.d directory and issue the command ./mysql-monitor-agent status.


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