Configuring the eG Agent with Access Privileges
For the eG agent to collect the required metrics from the target Maria Database server, the eG agent should be configured with the credentials of a user who has server-wide process and select privileges on the target Maria Database server.
If such a user does not pre-exist, then, in the user table of the mysql database of the target Maria Database server, you need to manually create a user account with the aforesaid privileges.
To achieve this, follow the procedure discussed below:
-
To create a new user account, you must connect to the Maria Database server as the mysql root user. For that, first login to the Maria database host, and at the command prompt, issue the following command:
mysql -u root
If you have assigned a password to the root account, you will also need to provide a -password or -p option, as shown below:
mysql -u root -p egurkha
-
After successfully logging into the Maria Database server, issue the following statement to access the mysql database, which holds the user table:
use mysql
-
Then, at the MySQL prompt, issue the following command to create a user:
CREATE USER ‘<username>’@’<IP_address_of_eG_agent>’ IDENTIFIED BY ‘<password>’;
GRANT PROCESS,SELECT ON *.* TO ‘<username>’@’<IP_address_of_eG_agent>’;
GRANT SELECT ON performance_schema.* TO ‘<username>’@’<IP_address_of_eG_agent>’;
For instance, to ensure that user john (with password john) is able to connect to the Maria Database server (being monitored) from the eG agent host, 192.168.8.91, the following command is to be issued:
CREATE USER ‘john’@’192.168.8.91’ IDENTIFIED BY ‘john’;
GRANT PROCESS,SELECT ON *.* TO ‘john’@’192.168.8.91’;
GRANT SELECT ON performance_schema.* TO ‘john’@’192.168.8.91’;
Note:
- The CREATE and GRANT commands are case-sensitive; therefore, take care while specifying the user name, password, and privileges.
- Only the IP address of the eG agent's host can be provided as part of the CREATE command's syntax; the host name of the eG agent cannot be provided instead.
-
To ensure that the external agent is able to execute the Maria SQL Network test, make sure that you create a user with the same credentials (i.e., name and password) and privileges as above and map that user to the IP address of the external agent. For instance, in the example above, to enable the external agent at IP address 192.168.8.92 to run the Maria SQL Network test, your command should be:
CREATE USER ‘john’@’192.168.8.91’ IDENTIFIED BY ‘john’;
GRANT PROCESS,SELECT ON *.* TO ‘john’@’192.168.8.92’;
GRANT SELECT ON performance_schema.* TO ‘john’@’192.168.8.92’;
- Once the above-mentioned commands execute successfully, the user table will be updated with two records for the user account that was newly created - one mapped to the internal/remote agent’s IP address and another mapped to the external agent’s IP address.
Then, proceed to configure the tests. While doing so, remember to configure the user name and password parameters with the name and password (respectively) that corresponds to the eG agent’s IP address in the user table.