15.6.3.5. Starting/Stopping the MySQL Enterprise Agent

The MySQL Enterprise Agent can be started and stopped at any time. When not running, information about the current status of your server will not be available, and MySQL Enterprise Service Manager will provide a warning if an agent and the MySQL server that it monitors is unavailable.

Warning

If you are using Query Analyzer, then turning off the agent will prevent your applications from communicating with the MySQL server. See Section 15.13, “The Query Analyzer Tab”.

15.6.3.5.1. Starting/Stopping the Agent on Windows

You have the option of starting the Monitor Agent from the final installation screen. Otherwise you can do this by going to the Start Menu and under Programs find MySQL and then the MySQL Enterprise Agent entry. Simply select the Start MySQL Enterprise Agent option.

Note

On Windows Vista or later, starting the agent requires administrative privileges—you must be logged in as an administrator. To start or stop the agent right-click the menu item and choose the Run as Administrator menu option. The same restriction applies to starting the agent from the command line. To open an administrator cmd window right-click the cmd icon and choose the Run as Administrator menu option.

Warning

To report its findings, the agent needs to be able to connect to the dashboard through the port specified during installation. The default value for this port is 18080; ensure that this port is not blocked. If you need help troubleshooting the agent installation see, Section 15.6.3.10, “Troubleshooting the Agent”.

Alternately, you can start the agent from the command line by entering:

shell> sc start MySQLEnterpriseMonitorAgent

or:

shell> net start MySQLEnterpriseMonitorAgent

You can also start the agent by issuing the command, agentctl.bat start. Stop the agent by passing the argument, stop. This batch file is found in the Agent directory.

For confirmation that the service is running you can open the Microsoft Management Console Services window. To do this go to the Control Panel, find Administrative Tools and click the link to Services. Locate the service named MySQL Enterprise Monitor Agent and look under the Status column.

You may also start the agent from this window rather than from the Start menu or the command line. Simply right-click MySQL Enterprise Agent and choose Start from the pop-up menu. Starting the agent from this window opens an error dialog box if the agent cannot connect to the MySQL server it is monitoring. No error is displayed if the agent is unable to connect to the MySQL Enterprise Service Manager.

The pop-up menu for starting the agent also offers the option of stopping the agent. To stop the agent from the command line you only need type:

shell> sc stop MySQLEnterpriseMonitorAgent

or:

shell> net stop MySQLEnterpriseMonitorAgent
Note

MySQLEnterpriseMonitorAgent is the default name of the Monitor Agent service. If you have added an additional agent as described in MySQL Server (agent-instance.ini) Configuration, replace MySQLEnterpriseMonitorAgent with the appropriate agent name.

15.6.3.5.2. Starting/Stopping the Agent on Mac OS X

The script to start the agent on Mac OS X 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:

shell> ./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 are running more than one agent on a specific machine, you must also specify the path to the ini file when you are stopping the agent. Executing mysql-monitor-agent stop without an ini file will only stop the agent associated with the default 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 or not. If the agent is not running, use the following command to view the last ten entries in the agent log file:

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

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

Installation creates the directory /Applications/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 /Applications/mysql/enterprise/agent/etc/init.d directory and execute mysql-monitor-agent help. You should see the 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 /Applications/mysql/enterprise/agent/etc/init.d directory, issue the command:

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

If you installed the agent as root, on reboot the mysql-monitor-agent daemon will start 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 have added an additional agent as described in MySQL Server (agent-instance.ini) Configuration, and you wish to start this agent on reboot, create a system initialization script appropriate to your operating system. To determine whether the agent is running or not navigate to the init.d directory and issue the command ./mysql-monitor-agent status.

Warning

To report its findings, the agent needs to be able to connect to the dashboard through the port specified during installation. The default value for this port is 18080; ensure that this port is not blocked. If you need help troubleshooting the agent installation see, Section 15.6.3.10, “Troubleshooting the Agent”.

15.6.3.5.3. 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 are running more than one agent on a specific machine, you must also specify the path to the ini file when you are stopping the agent. Executing mysql-monitor-agent stop without an ini file will only stop 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 or not. 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 15.6.3.10, “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. You should see the 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 will start 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 have added an additional agent as described in MySQL Server (agent-instance.ini) Configuration, and you wish to start this agent on reboot, create a system initialization script appropriate to your operating system. To determine whether the agent is running or not navigate to the init.d directory and issue the command ./mysql-monitor-agent status.

Warning

To report its findings, the agent needs to be able to connect to the dashboard through the port specified during installation. The default value for this port is 18080; ensure that this port is not blocked. If you need help troubleshooting the agent installation see, Section 15.6.3.10, “Troubleshooting the Agent”.

Copyright © 2010-2017 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout