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 2.3.7, “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
Section 2.3.6.2, “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
.
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 2.3.7, “Troubleshooting the Agent”.