Appendix C. MySQL Enterprise Monitor Component Reference

Table of Contents

C.1. MySQL Enterprise Service Manager Reference
C.1.1. Configuring Tomcat Parameters
C.1.2. Creating a new SSL KeyStore
C.1.3. Log Files for the MySQL Enterprise Service Manager
C.1.4. The Management Information Base (MIB) File
C.1.5. The config.properties File
C.2. MySQL Enterprise Agent Reference
C.2.1. MySQL Enterprise Agent Configurable Options
C.2.2. MySQL Server (agent-instance.ini) Configuration
C.2.3. Agent Log and pid Files

C.1. MySQL Enterprise Service Manager Reference

C.1.1. Configuring Tomcat Parameters

The parameters for the Tomcat hosting system used to support MySQL Enterprise Service Manager and MySQL Enterprise Dashboard can have an affect on the performance of the system.

The default settings for Java for Tomcat are as follows:

DescriptionParameterDefault Value
Initial heap size-Xms768MB
Maximum heap size-Xmx768MB
Java stack size-Xss128MB

You can change these parameters to higher values, by editing the JAVA_OPTS setting within the corresponding platform script.

  • On Unix/Linux and Mac OS X

    Edit the values within apache-tomcat/bin/setenv.sh file within your MySQL Enterprise Service Manager directory. You should avoid setting maximum figures higher than the physical memory of your system as this may reduce, rather than increase the performace.

    If you change these parameters, you should shutdown and restart MySQL Enterprise Service Manager for the changes to take effect.

  • Windows

    Edit the JAVA_OPTS settings within the apache-tomcat/bin/setenv.bat file.

    To enable the changes, you must re-install your service. To do this, shutdown your MySQL Enterprise Service Manager service and then reinstall the service by running:

    shell> mysqlmonitorctl.bat uninstall
    shell> mysqlmonitorctl.bat install
    

On all platforms, changes to the JAVA_OPTS using the above methods should be retained over an upgrade of the MySQL Enterprise Service Manager service.

If you are running the MySQL repository and the Tomcat service on the same machine, you should keep take the memory allocated to MySQL into consideration when setting these values.

C.1.2. Creating a new SSL KeyStore

The SSL certificate that is provided with the server during installation is a sample certificate only. If you want to use SSL for communicating with your MySQL Enterprise Service Manager and MySQL Enterprise Dashboard you should replace the supplied certificate with your own certificate.

The certificate keystore is located in the apache-tomcat/conf/myKeystore file within your MySQL Enterprise Service Manager installation.

To create a new, self-signed, certificate, use the keytool command (provided with Java SE Security) to create a new certificate file:

shell> keytool -genkey -alias tomcat -keyalg RSA -validity 1825 -keystore newKeystore

You will be prompted to fill in the certificate information and to provide a unique password for the certificate.

The -validity specifies the length of the certificate created, specified in days. The -alias is required to ensure that the certificate is associated with tomcat.

Once you have created the new keystore, you should shutdown MySQL Enterprise Service Manager, copy the new keystore file to apache-tomcat/conf/myKeystore and restart MySQL Enterprise Service Manager.

If you have an existing certificate that you would like to import into your keystore, you need to import the certificate using the following command:

shell> keytool -import -alias tomcat -keystore newKeystore -file public.pem

For more information on using SSL certificates in Tomcat see Apache Tomcat 6.0: SSL Configuration HOW-TO.

C.1.3. Log Files for the MySQL Enterprise Service Manager

This section shows the location of the log and configuration files associated with the various components that make up the MySQL Enterprise Service Manager. These files can prove useful for debugging purposes.

All log files except catalina.out are rotated to ensure they do not grow beyond 10MB in size.

Table C.1. MySQL Enterprise Monitor: Log File Locations: Windows

ComponentFile Location
Apache/TomcatC:\Program Files\MySQL\Enterprise\Monitor\apache-tomcat\logs\catalina.out
RepositoryC:\Program Files\MySQL\Enterprise\Monitor\mysql\data
Configuration ReportC:\Program Files\MySQL\Enterprise\Monitor\configuration_report.txt
Service ManagerC:\Program Files\MySQL\Enterprise\Monitor\apache-tomcat\logs\mysql-monitor.log

Table C.2. MySQL Enterprise Monitor: Log File Locations: Unix

ComponentFile Location
Apache/Tomcat/opt/mysql/enterprise/monitor/apache-tomcat/logs/catalina.out
Repository/opt/mysql/enterprise/monitor/mysql/data
Configuration Report/opt/mysql/enterprise/monitor/configuration_report.txt
Service Manager/opt/mysql/enterprise/monitor/apache-tomcat/logs/mysql-monitor.log

Table C.3. MySQL Enterprise Monitor: Log File Locations: Mac OS X

ComponentFile Location
Apache/Tomcat/Applications/mysql/enterprise/monitor/apache-tomcat/logs/catalina.out
Repository/Applications/mysql/enterprise/monitor/mysql/data
Configuration Report/Applications/mysql/enterprise/monitor/configuration_report.txt
Service Manager/Applications/mysql/enterprise/monitor/apache-tomcat/logs/mysql-monitor.log

All of these logs are viewable within MySQL Enterprise Dashboard. For more information, see Section 2.8.6, “Logs”.

Note

The configuration_report.txt file contains the repository password in plain text. You may want to store this file in a secure location.

On all operating systems, the Apache/Tomcat, and Repository directories contain both access and error files.

C.1.4. The Management Information Base (MIB) File

A MIB file is a requirement for using SNMP traps. A table showing the location of this file follows.

Table C.4. MySQL Enterprise Monitor: MIB File Locations

Operating SystemFile Location
WindowsC:\Program Files\MySQL\Enterprise\Monitor\support-files\MONITOR.MIB
Unix/opt/mysql/enterprise/monitor/support-files/MONITOR.MIB
Mac OS X/Applications/mysql/enterprise/monitor/support-files/MONITOR.MIB

C.1.5. The config.properties File

The repository user name and password are stored in in the config.properties file. A table showing the location of this file follows:

Table C.5. MySQL Enterprise Monitor: The config.properties File

Operating SystemFile Location
WindowsC:\Program Files\MySQL\Enterprise\Monitor\apache-tomcat\webapps\ROOT\WEB-INF
Unix/opt/mysql/enterprise/monitor/apache-tomcat/webapps/ROOT/WEB-INF
Mac OS X/Applications/mysql/enterprise/monitor/apache-tomcat/webapps/ROOT/WEB-INF

You should make sure that the file is secured at the file system level so that it cannot be read by anybody but the administrator or Enterprise monitor.

C.2. MySQL Enterprise Agent Reference

The MySQL Enterprise Agent is responsible for providing all of the information from a monitor MySQL server to MySQL Enterprise Service Manager. In addition, the MySQL Enterprise Agent may provide MySQL Enterprise Agent Proxy Service functionality for providing query analyzer data.

The MySQL Enterprise Agent is configured through files located within the etc directory within agent installation directory.

Configuration is stored in multiple files, according to a predetermined file and directory layout. The primary configuration file contains specific information about the agent and how the agent communicates with MySQL Enterprise Service Manager. The main configuration is located within the mysql-monitor-agent.ini file.

Additional configuration files contain information about the MySQL server that is being monitored. You can configure which directory is used for storing this information within the mysql-monitor-agent.ini file. The default location is the etc/instances directory within the MySQL Enterprise Agent directory.

The server you want to monitor should have a directory within the specified location, optionally using the name of the server you are monitoring, and within that directory, an agent-instance.ini file. This file contains the configuration information for connecting to the MySQL server, including the host name, port, user credentials and display name.

You can see an example of the file layout of the etc directory:

.
./init.d
./init.d/mysql-monitor-agent
./instances
./instances/agent
./instances/agent/agent-instance.ini
./mysql-monitor-agent.ini

For more information on the configuration of the mysql-monitor-agent.ini file, see Section C.2.1, “MySQL Enterprise Agent Configurable Options”. For details on the content of the individual MySQL instance configuration files, see Section C.2.2, “MySQL Server (agent-instance.ini) Configuration”.

C.2.1. MySQL Enterprise Agent Configurable Options

The mysql-monitor-agent.ini files contains the base configuration information for the MySQL Enterprise Agent. The file sets the core information about the supported functionality for the entire agent.

You can see a sample of the configuration file below:

# WARNING - The UUID defined below must be unique for each agent.
#
# To use this INI file as a template for configuring additional
# agents, do not simply copy and start a new agent without first
# modifying the UUID and adjusting other parameters as necessary.
#
# WARNING - If you are upgrading from a previous 1.x release, please
# note that we have changed the contents of the agent INI file and
# split the contents across two files:
#
#   <installdir>/etc/mysql-monitor-agent.ini              - this file
#   <installdir>/etc/instances/mysql/agent-instance.ini   - new file
#
# Refer to the documentation for more detailed information and
# instructions.
#
# Version: 2.2.0.1708

[mysql-proxy]

# Common Parameters
plugins=proxy,agent
keepalive = true

log-file = mysql-monitor-agent.log
pid-file=/opt/mysql/enterprise/agent/mysql-monitor-agent.pid

# Agent Parameters
agent-mgmt-hostname = http://nautilus:18080/heartbeat
agent-mgmt-username = agent
agent-mgmt-password = Tamsin
mysqld-instance-dir= etc/instances
agent-item-files = share/mysql-monitor-agent/items/quan.lua,share/mysql-monitor-agent/items/items-mysql-monitor.xml,share/mysql-monitor-
agent/items/custom.xml
agent-uuid = 68b4892c-1310-4f07-8924-3a8b3c0e850b
user = root

# Proxy Parameters
proxy-address=:6446
proxy-backend-addresses = 127.0.0.1:3306
proxy-lua-script = lib/mysql-monitor-agent/lua/quan.lua
Note

Do not copy the agent configuration information from one machine to another without changing the agent-uuid. Each agent instance must have a unique agent id.

The main configuration information must be located within the [mysql-proxy] section of the configuration file. The main configurable parameters within this file are:

The MySQL Enterprise Agent supports the following configurable options:

Table C.6. mysql-monitor-agent Help Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--help Show help options
--help-admin Show options for the admin-module
--help-agent Show agent options
--help-all Show all help options
--help-monitor Show monitor options
--help-proxy Show options for the proxy-module

Table C.7. mysql-monitor-agent Admin Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--admin-addressadmin-addressDefines the listening address and port for the admin module
--admin-lua-scriptadmin-lua-scriptScript to execute by the admin module
--admin-passwordadmin-passwordPassword for authentication for admin module
--admin-usernameadmin-usernameUsername for authentication for admin module
--proxy-addressproxy-addressListening address:port of the proxy server

Table C.8. mysql-monitor-agent Agent Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--agent-backlog-timeoutagent-backlog-timeoutMaximum time in seconds that the Set the second after the minute when the data is sent to the server2.2.0
--agent-collector-pluginsagent-collector-pluginsLoad the specified collector plugins
--agent-connect-timeoutagent-connect-timeoutThe timeout for the agent to connect to the MySQL server2.2.2
--agent-DNS-cachetimeoutagent-DNS-cachetimeoutThe timeout for cache operations2.2.0
--agent-force-uncorkingagent-force-uncorkingForcibly turn off corking (randomization of data collection intervals)
--agent-generate-uuidagent-generate-uuidGenerate a UUID for use with the agent-uuid
--agent-heartbeat-intervalagent-heartbeat-intervalThe interval for generating heartbeat operations
--agent-host-idagent-host-idThe host ID for the agent
--agent-host-id-commandlineagent-host-id-commandlineThe command to use to generate the agent host id
--agent-hostnameagent-hostnameHostname of the agent host
--agent-IP-versionagent-IP-versionIP version (4 or 6) to force2.2.0
--agent-item-filesagent-item-filesList of data items for additional collections
--agent-master-uuid-discoveryagent-master-uuid-discoveryDisable the use of the master_uuid for topology discovery2.2.1
--agent-max-response-sizeagent-max-response-sizeMaximum response size for agent data
--agent-mgmt-hostnameagent-mgmt-hostnameURL of the management server
--agent-mgmt-passwordagent-mgmt-passwordPassword for the management server2.2.0
--agent-mgmt-usernameagent-mgmt-usernameUser name with the management server2.2.0
--agent-net-timeoutagent-net-timeoutThe timeout for the agent for established connections to the MySQL server2.2.2
--agent-report-network-fsagent-report-network-fsEnable data collection for networked filesystems2.2.0
--agent-report-offsetagent-report-offsetSet the second after the minute when the data is sent to the server2.2.0
--agent-run-os-testsagent-run-os-testsRun the operating system tests and shutdown
--agent-sync-attemptsagent-sync-attemptsSynchronize the attempts to connect at resync
--agent-track-allocagent-track-allocEnable the tracking of the allocation sizes
--agent-uuidagent-uuidUUID of this agent
--mysqld-instance-dirmysqld-instance-dirLocation of the MySQL instance configuration (mysql.cnf/mysql.ini) files2.2.0

Table C.9. mysql-monitor-agent Monitor Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--monitor-intervalmonitor-intervalInterval for executing queries against the backend
--monitor-lua-scriptmonitor-lua-scriptScript filename for the monitor
--monitor-passwordmonitor-passwordSet the password for the monitored MySQL Server
--monitor-usernamemonitor-usernameSet the username for the monitored MySQL Server

Table C.10. mysql-monitor-agent Proxy Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--no-proxyno-proxyDon't start the proxy module
--proxy-backend-addressesproxy-backend-addressesAddress:port of the remote MySQL server
--proxy-fix-bug-25371proxy-fix-bug-25371Enable the fix for Bug#25371 (for mysqld > 2.0.0.12) for older libmysql versions
--proxy-lua-scriptproxy-lua-scriptFilename for Lua script for proxy operations
--proxy-pool-no-change-userproxy-pool-no-change-userDon't use the protocol CHANGE_USER to reset the connection when coming from the connection pool
--proxy-read-only-backend-addressesproxy-read-only-backend-addressesAddress:port of the remote MySQL server (read-only)
--proxy-skip-profilingproxy-skip-profilingDisabled profiling of queries

Table C.11. mysql-monitor-agent Application Options

FormatOption FileDescriptionIntroductionDeprecatedRemoved
--basedirbasedirSpecify the base directory to prepend to paths in the config
--daemondaemonStart in daemon-mode
--defaults-filedefaults-fileSpecify the configuration file
--keepalivekeepaliveTry to restart the proxy if a crash occurs
--log-backtrace-on-crashlog-backtrace-on-crashTry to invoke the debug and generate a backtrace on crash
--log-filelog-fileSpecify the file for logging error messages
--log-levellog-levelLogging level
--log-use-sysloglog-use-syslogLog errors to syslog
--lua-cpathlua-cpathSet the LUA_CPATH
--lua-pathlua-pathSet the LUA_PATH
--max-open-filesmax-open-filesSpecify the maximum number of open files to support
--pid-filepid-filePID file to store the process ID (when in daemon mode)
--plugin-dirplugin-dirPath to the plugin files
--pluginspluginsList of plugins to load
--useruserSpecify the user to use when running mysql-monitor-agent
--verbose-shutdownverbose-shutdownReport shutdown in the logs regardless of log level2.2.0
--versionversionShow the version information
  • --help

    Command-Line Format--help
    -?

    Show available help options.

  • --help-all

    Command-Line Format--help-all

    Show all help options.

  • --help-admin

    Command-Line Format--help-admin

    Show options for the admin-module.

  • --help-proxy

    Command-Line Format--help-proxy

    Show options for the proxy-module.

  • --help-monitor

    Command-Line Format--help-monitor

    Show options for the monitor module.

  • --help-agent

    Command-Line Format--help-agent

    Show options for the agent module.

  • --admin-address=host:port

    Command-Line Format--admin-address
    Option-File Formatadmin-address
    Permitted Values
    Typestring
    Default:4041

    Specify the host name (or IP address) and port for the administration port. The default is localhost:4041.

  • --admin-lua-script=script

    Command-Line Format--admin-lua-script
    Option-File Formatadmin-lua-script
    Permitted Values
    Typefile name
    Default

    Specify the script to use for the administration module for the proxy.

  • --admin-password=pass

    Command-Line Format--admin-password
    Option-File Formatadmin-password
    Permitted Values
    Typestring
    Default

    Define the password to use to authenticate users wanting to connect to the administration module of mysql-monitor-agent. The administration module uses the MySQL protocol to request a username and password for connections.

  • --admin-username=user

    Command-Line Format--admin-username
    Option-File Formatadmin-username
    Permitted Values
    Typestring
    Defaultroot

    Define the username to use to authenticate users wanting to connect to the administration module of mysql-monitor-agent. The default username is root. The administration module uses the MySQL protocol to request a username and password for connections.

  • --agent-collector-plugins=user

    Command-Line Format--agent-collector-plugins
    Option-File Formatagent-collector-plugins
    Permitted Values
    Typenumeric
    Defaultcollect_lua

    A comma-separated list of the plugins to be used and loaded by the agent and used to provide collector items.

    When monitoring servers you must have the agent plugin configured. To support Query Analyzer, you must also have the proxy module enabled. Plugins should be specified as a comma separated list of plugin names.

    If you enabled Query Analyzer during installation of the agent, the default value is proxy,agent. If you disabled Query Analyzer during installation, the default value is agent.

  • --agent-connect-timeout=seconds

    Version Introduced2.2.2
    Command-Line Format--agent-connect-timeout
    Option-File Formatagent-connect-timeout
    Permitted Values
    Typenumeric
    Default10

    The timeout for the agent to connect to the MySQL server before a failure is reported.

  • --agent-DNS-cachetimeout=seconds

    Version Introduced2.2.0
    Command-Line Format--agent-DNS-cachetimeout
    Option-File Formatagent-DNS-cachetimeout
    Permitted Values
    Typenumeric
    Default0
    Valid Values-1Never timeout
    0Don't cache

    The timeout for caching the IP address of a given DNS name. By default, the operating system caching of the address is used and no caching in the agent is performed at all. If you specify -1 caching is enabled and never times out. Any other positive value specifies the timeout value.

  • --agent-net-timeout=seconds

    Version Introduced2.2.2
    Command-Line Format--agent-net-timeout
    Option-File Formatagent-net-timeout
    Permitted Values
    Typenumeric
    Default10

    The timeout for the agent to get a response from a MySQL server to which it is already connected before the failure is reported.

  • --agent-report-network-fs

    Version Introduced2.2.0
    Command-Line Format--agent-report-network-fs
    Option-File Formatagent-report-network-fs
    Permitted Values
    Typeboolean
    Defaultoff

    Enables data collection for network filesystems. In MySQL Enterprise Agent 2.2.2 and greater, the reporting of network filesystem information is disabled because the latency in determining and reporting the information can delay the collection and reporting of other information. You must manually enable collection if you need or use advisor and graphs that perform custom data collection on networked filesystems.

  • --agent-force-uncorking

    Command-Line Format--agent-force-uncorking
    Option-File Formatagent-force-uncorking

    Forcibly turn off the corking of responses sent to MySQL Enterprise Service Manager. The corking mechanism tries to randomize the reporting interval of data sent up to the server to prevent flooding the server with information.

    You can combine this option with the ---agent-report-offset to specify the offset when data is reported to the server. For more information, see agent-report-offset.

    The frequency of collecting the data is not modified by this setting.

  • --agent-generate-uuid

    Command-Line Format--agent-generate-uuid
    Option-File Formatagent-generate-uuid

    Regenerates a UUID for the agent. You can use this to generate a new UUID if you have copied configuration information for an agent from one machine to another. To use:

    shell> /opt/mysql/enterprise/agent/bin/mysql-monitor-agent --agent-generate-uuid
    ee9296d7-f7cd-4fee-8b26-ead884ebf398
    2009-03-05 11:49:37: (critical) shutting down normally
    

    For more information, see Section 5.3.6, “Monitoring Multiple MySQL Servers”.

  • --agent-heartbeat-interval=#

    Command-Line Format--agent-heartbeat-interval
    Option-File Formatagent-heartbeat-interval
    Permitted Values
    Typenumeric
    Default3

    Specify the heartbeat interval. The agent sends heartbeat messages to MySQL Enterprise Service Manager to indicate that it is alive and still running and monitoring servers. The MySQL Enterprise Service Manager uses this information to help identify when an agent is available or not.

  • --agent-host-id=HOSTID

    Command-Line Format--agent-host-id
    Option-File Formatagent-host-id

    Define the agent host id. The host id should be a unique identifier for the host on which the agent is running, and is different to the agent UUID. You can override the host ID for use within HA environments where you have two identical agent configurations, one on a live server, and one on a backup server to be brought into use if the primary server fails. The host ID is used to identify the host by the server, and during failover you want the host ID to remain constant as you monitor either the original or failover (replacement) server.

  • --agent-host-id=HOSTID

    Version Introduced2.2.0
    Command-Line Format--agent-IP-version
    Option-File Formatagent-IP-version
    Permitted Values
    Typenumeric
    Defaultany
    Valid Values4, 6

    Specify the IP version to be used and supported by MySQL Enterprise Agent. By default, the agent supports both IPv4 and IPv6, or you can specify the version by specifying 4 or 6.

  • --host-id-commandline

    Command-Line Format--agent-host-id-commandline
    Option-File Formatagent-host-id-commandline

    Specify the command line to generate the host ID. By default, the host ID is generated by using a variety of methods configured for a specific platform, including using SSH keys and embedded host ID information. You can replace this with an alternative command-line

  • --agent-hostname

    Command-Line Format--agent-hostname
    Option-File Formatagent-hostname

    Override the automatically determined hostname. You can use this to specify an alternate hostname for the agent. This can be useful if your host has multiple hostnames and you want the machine identified by a specific hostname.

    Note

    Setting the hostname using the Manage Servers tab within MySQL Enterprise Dashboard overrides this setting.

  • --agent-item-files

    Command-Line Format--agent-item-files
    Option-File Formatagent-item-files

    A comma separated list of the item files used to load data items that are then collected and sent to MySQL Enterprise Service Manager. For more information, see Section 4.1.8, “Creating a Custom Data Collection Item”.

    The default value includes share/mysql-proxy/items/quan.lua (which provides Query Analyzer data) and share/mysql-proxy/items/items-mysql-monitor.xml (which provides the core agent monitoring data).

  • --agent-max-response-size

    Command-Line Format--agent-max-response-size
    Option-File Formatagent-max-response-size
    Permitted Values
    Typenumeric
    Default65536

    Specify the maximum size of the response packet sent to MySQL Enterprise Service Manager

  • --agent-master-uuid-discovery

    Version Introduced2.2.1
    Command-Line Format--agent-master-uuid-discovery
    Option-File Formatagent-master-uuid-discovery
    Permitted Values
    Typeboolean
    Defaulttrue

    By default, the MySQL Enterprise Agent uses the UUID of the replication master to aid in identifying the replication topology. Setting this option to false prevents the agent from accessing the master.info and using the UUID obtained from the replication master. Instead, the hostname and port information is used to determine the topology and match the instance and master information.

  • --agent-mgmt-hostname

    Command-Line Format--agent-mgmt-hostname
    Option-File Formatagent-mgmt-hostname

    Set the URL of the MySQL Enterprise Service Manager where collected data is sent. The URL should include the username and password for the agents, for example: http://agent:password@memserver:18080/heartbeat.

    Note

    If you have the http_proxy environment variable configured within your environment, you should add the value of agent-mgmt-hostname to the no_proxy variable to ensure that data is correctly transmitted to MySQL Enterprise Service Manager and not redirected through the configured proxy address.

  • --agent-mgmt-username

    Version Introduced2.2.0
    Command-Line Format--agent-mgmt-username
    Option-File Formatagent-mgmt-username
    Permitted Values
    Typestring

    The username to be used when communicating with MySQL Enterprise Service Manager.

  • --agent-mgmt-password

    Version Introduced2.2.0
    Command-Line Format--agent-mgmt-password
    Option-File Formatagent-mgmt-password
    Permitted Values
    Typestring

    The password to be used when communicating with MySQL Enterprise Service Manager.

  • --agent-report-offset

    Version Introduced2.2.0
    Command-Line Format--agent-report-offset
    Option-File Formatagent-report-offset
    Permitted Values
    Typenumeric
    Defaultrandom

    The offset, in seconds, past the minute when data is sent up to MySQL Enterprise Service Manager. You can use this to harmonize or synchronize agent report across multiple machines, which can improve performance.

    For example, if you set --agent-report-offset=15, then data is reported at 15 seconds past each minute. For example, at 12:00:15, 12:01:15, and so on.

  • --agent-run-os-tests

    Command-Line Format--agent-run-os-tests
    Option-File Formatagent-run-os-tests

    Runs the internal operating system tests, and then exits. Using this option generates a large body of information about the various operating system information that can be collected about the host. You can use this to determine whether the agent is collecting the right amount, quantity and quality of information to the server.

    A truncated sample of the output is provided below:

    2010-01-22 16:15:45: (critical) MySQL Monitor Agent 2.2.1.1138 started.
    sigar-test-all.c.128 ():
      pid = 1353
    sigar-test-all.c.110 ():
      mem.ram = 6080,
      mem.total = 6374154240,
      mem.used = 3356090368,
      mem.free = 3018063872,
      mem.actual_free = 3018063872,
      mem.actual_used = 3356090368
    sigar-test-all.c.143 ():
      swap.total = 28523896832,
      swap.used = 710623232,
      swap.free = 27813273600
    sigar-test-all.c.169 ():
      cpu.user = 24544920,
      cpu.sys = 136764840,
      cpu.nice = 0,
      cpu.idle = 1234759920,
      cpu.wait = 0,
      cpu.total = 349015500
    sigar-test-all.c.194 ():
    [0]
      cpu.user = 8516770,
      cpu.sys = 56838970,
      cpu.nice = 0,
      cpu.idle = 283667220,
      cpu.wait = 0,
      cpu.total = 349022960
    [1]
      cpu.user = 6130420,
      cpu.sys = 12671090,
      cpu.nice = 0,
    ...
    
  • --agent-sync-attempts

    Command-Line Format--agent-sync-attempts
    Option-File Formatagent-sync-attempts

    Attempt to synchronize with the server during the resynchronization.

  • --track-alloc

    Command-Line Format--agent-track-alloc
    Option-File Formatagent-track-alloc

    Track the memory allocation in the various modules of the agent to help monitor the memory usage.

  • --agent-uuid

    Command-Line Format--agent-uuid
    Option-File Formatagent-uuid
    Permitted Values
    Typestring

    Specify the agent UUID. A UUID is automatically generated for each agent during installation, with the UUID automatically added to the configuration. You can generate a new UUID using the agent-generate-uuid command line option.

    If you are setting up multiple hosts and copying the configuration between hosts, make sure that the agent-uuid is unique. You can have the agent create a new UUID by leaving this configuration property blank.

  • --basedir

    Command-Line Format--basedir
    Option-File Formatbasedir
    Permitted Values
    Typefile name

    Specify a base directory that is prepended to all other filename configuration options. Use an absolute (not relative) directory name, otherwise mysql-monitor-agent generates an error during startup.

  • --defaults-file

    Command-Line Format--defaults-file
    Option-File Formatdefaults-file

    Specify a file to use as the file with configuration information. If not specified, configuration options are only taken from the command line.

  • --event-threads=#

    Command-Line Format--event-threads
    Option-File Formatevent-threads
    Permitted Values
    Typenumeric
    Default1

    Specify the number of event threads reserved to handle incoming requests.

  • --keepalive

    Command-Line Format--keepalive
    Option-File Formatkeepalive

    Creates an angel process surrounding the main mysql-monitor-agent that attempts to restart the true mysql-monitor-agent process in the event a crash or other failure.

    If the agent stops unexpectedly, the angel revives the agent.

    An expected shutdown is:

    • MySQL Enterprise Agent terminates normally

    • Shutdown with SIGTERM

    • Startup errors

    If the angel recieves one of SIGHIP, SIGTERM, or SIGINT signals, the signal is forwarded to the agent to initiate shutdown.

  • --agent-backlog-timeout=VALUE

    Version Introduced2.2.0
    Command-Line Format--agent-backlog-timeout
    Option-File Formatagent-backlog-timeout
    Permitted Values
    Typenumeric

    The time in seconds that data is kept by the agent if the agent is unable to communicate with MySQL Enterprise Service Manager. Once the agent reconnects, the data is sent up to MySQL Enterprise Service Manager. Data older than the specified value is discarded. The default value is 600 seconds.

  • --log-backtrace-on-crash

    Command-Line Format--log-backtrace-on-crash
    Option-File Formatlog-backtrace-on-crash

    Logs the backtrace to the error log and tries to initialize the debugger in the event of a failure.

  • --log-file=filename

    Command-Line Format--log-file
    Option-File Formatlog-file
    Permitted Values
    Typefile name

    Specify the name of a file to be used to record log information. If you do not specify a full path name, then the log file location is considered to be relative to the installation directory of the agent.

  • --log-file=filename

    Command-Line Format--log-level
    Option-File Formatlog-level
    Permitted Values
    Typeenumeration
    Defaultcritical
    Valid ValueserrorShow error messages
    warningShow only warning messages
    infoShow informational messages
    messageShow information about agent and basic processing
    criticalShow critical messages highlighting agent problems
    debugShow detailed information, including info provided to server

    The log level used when outputting error messages. Messages of that level (or lower) are output. For example, message also outputs info, warning, and error messages.

    Warning

    Be careful when setting the log-level to debug. Doing this rapidly increases the size of your mysql-monitor-agent.log file. To avoid disk space problems, put the log files on a different drive from your MySQL server and the MySQL Enterprise Dashboard.

    It is strongly recommended that you use a log-level of critical or error in a production server. Use the higher-levels to provide more detailed information only for debugging problems with your agent.

    Under Windows, if you restart the agent from the command line after setting the log-level to debug, extensive debug information is displayed to the console as well as to the log file.

  • --log-use-syslog

    Command-Line Format--log-use-syslog
    Option-File Formatlog-use-syslog

    Causes errors to be sent to the syslog (Unix/Linux only).

  • --lua-cpath=path

    Command-Line Format--lua-cpath
    Option-File Formatlua-cpath
    Permitted Values
    Typefile name

    Specify the LUA_CPATH to be used when loading compiled modules or libraries for Lua scripts.

  • --lua-path=path

    Command-Line Format--lua-path
    Option-File Formatlua-path
    Permitted Values
    Typefile name

    Specify the LUA_CPATH to be used when loading modules for Lua.

  • --max-open-files=#

    Command-Line Format--max-open-files
    Option-File Formatmax-open-files
    Permitted Values
    Typenumeric

    The maximum number of open files and sockets supported by the mysql-monitor-agent process. You may need to increase this with certain scripts.

  • --monitor-interval=#

    Command-Line Format--monitor-interval
    Option-File Formatmonitor-interval
    Permitted Values
    Typenumeric
    Default1
    Min Value1

    Execute queries against the backends at this interval. The default is 1.

  • --monitor-lua-script=SCRIPT

    Command-Line Format--monitor-lua-script
    Option-File Formatmonitor-lua-script
    Permitted Values
    Typestring

    Filename of the Lua script to use for the monitor module.

  • --monitor-password=PASS

    Command-Line Format--monitor-password
    Option-File Formatmonitor-password
    Permitted Values
    Typestring

    The password for the monitoring user account.

  • --monitor-username=USER

    Command-Line Format--monitor-username
    Option-File Formatmonitor-username
    Permitted Values
    Typestring
    Defaultmonitor

    The username for the monitoring user account.

  • --mysqld-instance-dir=PATH

    Version Introduced2.2.0
    Command-Line Format--mysqld-instance-dir
    Option-File Formatmysqld-instance-dir
    Permitted Values
    Typestring

    The path to the configuration files for the MySQL instance.

  • --agent-IP-version=VER

    Version Introduced2.2.0
    Command-Line Format--agent-IP-version
    Option-File Formatagent-IP-version
    Permitted Values
    Typenumeric
    Defaultany
    Valid Values4, 6

    Explicitly sets the IP version to be used for addressing. By default, the agent uses either version. Set the value by specifying 4 (for IPv4) or 6 (for IPv6).

  • --no-proxy

    Command-Line Format--no-proxy
    Option-File Formatno-proxy

    Disable the proxy module.

  • --plugin-dir=path

    Command-Line Format--plugin-dir
    Option-File Formatplugin-dir
    Permitted Values
    Typefile name

    The directory to use when loading plugins for mysql-monitor-agent.

  • --plugins=plugin,...

    Command-Line Format--plugins
    Option-File Formatplugins
    Permitted Values
    Typestring

    A comma-separated list of the plugins to be loaded.

  • --proxy-address=host:port

    Command-Line Format--proxy-address
    -P
    Option-File Formatproxy-address
    Permitted Values
    Typestring
    Default:6446

    The listening host name (or IP address) and port of the proxy service. The default is :6446 (all IPs on port 6446). The setting is used when employing Query Analysis as the address/port that you must configure your application to use in place of your normal MySQL server. By default this item is set during installation.

  • --proxy-read-only-backend-addresses=host:port

    Command-Line Format--proxy-read-only-backend-addresses
    -r
    Option-File Formatproxy-read-only-backend-addresses
    Permitted Values
    Typestring

    The listening host name (or IP address) and port of the proxy server for read-only connections. The default is for this information not to be set.

  • --proxy-backend-addresses=host:port

    The host name (or IP address) and port of the MySQL server to connect to. You can specify multiple backend servers by supplying multiple options. Clients are connected to each backend server in round-robin fashion. For example, if you specify two servers A and B, the first client connection goes to server A; the second client connection goes to server B; and the third client connection goes to server A.

  • --proxy-pool-no-change-user

    Command-Line Format--proxy-pool-no-change-user
    Option-File Formatproxy-pool-no-change-user

    Disables the use of the MySQL protocol CHANGE_USER when re-using a connection from the pool of connections specified by the backend-addresses list.

  • --proxy-skip-profiling

    disables profiling of queries (tracking time statistics). The default is for tracking to be enabled.

  • --proxy-fix-bug-25371

    Command-Line Format--proxy-fix-bug-25371
    Option-File Formatproxy-fix-bug-25371

    Gets round an issue when connecting to a MySQL server later than 5.1.12 when using a MySQL client library of any earlier version.

  • --proxy-lua-script=file

    Command-Line Format--proxy-lua-script
    -s
    Option-File Formatproxy-lua-script
    Permitted Values
    Typefile name

    Specify the Lua script file to be loaded. Note that the script file is not physically loaded and parsed until a connection is made. Also note that the specified Lua script is reloaded for each connection; if the content of the Lua script changes while mysql-monitor-agent is running, the updated content is automatically used when a new connection is made. To use Query Analyzer, set this parameter to share/mysql-proxy/quan.lua. This is the default value.

  • --daemon

    Command-Line Format--daemon
    Option-File Formatdaemon

    Starts the proxy in daemon mode.

  • --pid-file=file

    Command-Line Format--pid-file
    Option-File Formatpid-file
    Permitted Values
    Typefile name

    Sets the name of the file to be used to store the process ID. This is used by the script that shuts down the agent to identify the process to be shutdown. The default value is the mysql-monitor-agent.pid file within the base installation directory as created by the agent

  • --user=user

    Command-Line Format--user
    Option-File Formatuser
    Permitted Values
    Typestring

    Run mysql-monitor-agent as the specified user.

  • --version

    Command-Line Format--version
    -V
    Option-File Formatversion

    Show the version number.

  • --verbose-shutdown

    Version Introduced2.2.0
    Command-Line Format--verbose-shutdown
    Option-File Formatverbose-shutdown
    Permitted Values
    Typeboolean
    Defaultoff

    By default, agent shutdown messages are only logged if you have set log-level to message or higher. You can force shutdown messages to be reported regardless of the log level using this option.

C.2.2. MySQL Server (agent-instance.ini) Configuration

For the MySQL server that you want to monitor, you must create an agent-instance.ini within the directory specified by the mysqld-instance-dir configuration parameter within the main mysql-monitor-agent.ini file.

The agent-instance.ini file contains the host name and user credentials for connecting to the MySQL server that you want the agent to monitor. The format of the file is as follows:

# To use this .ini file as a template for configuring additional
# instances to monitor, do not simply copy and start a new agent
# without first modifying the displayname.
#
# Refer to the documentation for more detailed information and
# instructions.
#
# Version: 20080718_230416_r7011

[mysqld]
hostname = 127.0.0.1
port     = 3306
user     = root
password =

The individual configuration parameters can be defined as follows:

  • hostname: The host name of the MySQL server that you want to monitor.

  • port: The TCP/IP port of the MySQL server that you want to monitor.

  • user: The user to use when connecting to the MySQL server that you want to monitor.

  • password: The corresponding password to use when connecting to the MySQL server that you want to monitor.

It is also possible to configure the agent to use sockets. This can be done during installation by selecting “socket” rather than “TCP/IP” from the menu and then specifying the socket name. This can also be configured after installation by editing the agent-instance.ini configuration file, and adding the line:

socket = /full/path/to/mysql.sock

Replication topology discovery for an instance is determined by the agent using the master.info file for the instance, extracting the username/password used to connect to the master, and then obtaining the MySQL Enterprise Monitor generated UUID of the replication master. This enables the MySQL Enterprise Agent to match the slave and master in the replication topology.

You can provide alternative credentials to be used to obtain the master UUID by adding a replication section to the instance configuration file, and providing values for the discovery-username and discovery-password options. For example:

[replication]
discovery-username=agentdiscovery
discovery-password=password

To switch off the use of the master UUID entirely when determining the replication topology, use the agent-master-uuid-discovery option.

C.2.3. Agent Log and pid Files

The locations of the agent log files are as follows:

  • Windows: C:\Program Files\MySQL\Enterprise\Agent\mysql-monitor-agent.log

  • Unix: /opt/mysql/enterprise/agent/mysql-monitor-agent.log

  • Mac OS X: /Applications/mysql/enterprise/agent/mysql-monitor-agent.log

On any platform, the location of the agent log file may be changed. You may also change the name of the log file. To confirm the location and the name, check the settings in the mysql-monitor-agent.ini file.

The maximum size of a log file may be limited to 2GB. If MySQL Enterprise Agent cannot add information to the configured logfile, then information is sent to the standard output instead.

Because the size of the log files can become quite large, you can use a tool such as logrotate (Unix/Linux) or logadm (Solaris) to automatically rotate the logs. For example, a sample logrotate definition is shown below:

/opt/mysql/enterprise/agent/mysql-monitor-agent.log {
    rotate 5
    daily
    minsize 1G
    postrotate
        /usr/bin/killall -HUP mysql-monitor-agent
    endscript
}

The above rotates the log before it reaches 1GB in size, keeping up to 5 files at a time.

To use your own system, you can copy the log file, flush the contents, and then send the SIGHUP signal to the agent process. On Windows, you need to shutdown, copy the log, and restart the agent.

The locations of the agent pid files are as follows:

  • Windows: C:\Program Files\MySQL\Enterprise\Agent\agent\mysql-monitor-agent.pid

  • Unix: /opt/mysql/enterprise/agent/mysql-monitor-agent.pid

  • Mac OS X: /Applications/mysql/enterprise/agent/mysql-monitor-agent.pid

On any platform, the location of the agent log file may be changed. You may also change the name of the log file. To confirm the location and the name, check the settings in the mysql-monitor-agent.ini file.