MySQL Enterprise Monitor 8.0.38 Manual

31.2.2.2 Main Queries

The main queries enable you to retrieve data from the monitored server.

When defining queries, the following restrictions apply:

For each value retrieved from the server, you must assign a name. That is, you must use the following format, where NAME is the name applied to the data collection:

  SELECT X AS NAME FROM Y

The items are displayed in the Data Item drop-down menu on the Variable Assignment frame of the new Advisor page. They take the following format: namespace:classname:name. For example, mysql:status:open_files_limit.

Note

The examples used in this section are taken from the default advisors delivered with your MySQL Enterprise Monitor installation.

The following example is used by the Server Has Anonymous Accounts advisor:

<class>
	<namespace>mysql</namespace>
	<classname>anonymous_user</classname>
	<query><![CDATA[SELECT COUNT(*) AS user_count FROM mysql.user WHERE user='']]></query>
</class>

In this advisor, the variable %user_count% is mapped to the Data Item mysql:anonymous_user:user_count defined in the query.