Bug #41630 A more intelligent agent installer
Submitted: 19 Dec 2008 10:46 Modified: 27 May 2010 12:54
Reporter: Johan Idrén Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Installing Severity:S3 (Non-critical)
Version:2.0 OS:Any
Assigned to: BitRock Merlin CPU Architecture:Any

[19 Dec 2008 10:46] Johan Idrén
Description:
During installation of agent, connection details for both the monitored mysqld and the dashboard are suggested. But this could be made much better to lower pressure on support staff and make customers happier.

Also other stuff.

How to repeat:
Install, fail to know how to connect to your own mysqld, sit there not having anything monitored. Contact support!

Suggested fix:
Agent installer could:

Look in the default locations for my.cnf/ini, parse connection details (port, socket) and automatically fill in.

Offer to create an agent account, prompting for root/equivalent login details.

Test connection to dashboard, if it fails list most common causes (firewalls!).

Verify that monitored server and dashboard have similar time set and if not, show a note that graphs will be displayed on the dashboard according to the time on the monitored server.
[4 Nov 2009 15:59] BitRock Merlin
The Agent installer does not include the MySQL client. How should the Agent installer login into the MySQL database? Should the installer assume that the MySQL client is in the PATH? Should the installer ask for the location of MySQL client?
[5 Nov 2009 16:38] Andy Bang
Assume it's on the path and proceed.  If you can't run the MySQL client, that's a serious error because not only can't the installer use it to create/validate, the Agent can't use it to monitor the mysqld either.  So if that's the case (i.e. you can't run the MySQL client), please show an error message and terminate without installing, advising the user to fix the path and start the installation again.
[10 Nov 2009 11:43] BitRock Merlin
Patch sent to Keith.

According to the requirements the installer will run the following command if the user select "yes, use the credentials below to create the Agent's user account"  on the Agent User Account Creation screen:

GRANT SELECT, REPLICATION CLIENT, SHOW DATABASES, SUPER, PROCESS
  ON *.*
  TO 'agent_user'@'%'
  IDENTIFIED BY 'agent_password';
GRANT CREATE, INSERT, SELECT
  ON mysql.*
  TO 'agent_user'@'%'

However we have noticed the following issue on Windows. It has been necessary to execute the same command for the 'agent_user'@'localhost'. I think that the agent user should have the same privileges if it is accessing from the same machine so IMHO that it is necessary to also run the same actions using "localhost" on Windows.

The implemented approach is the same that it is specified in the Agent spec file, we only want to let you know this issue. Please let us know if we need to implement any additional step for Windows installer.
[11 Nov 2009 23:27] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in version => 2.2.0.1536.
[4 Feb 2010 13:33] BitRock Merlin
Patch sent to Keith.
[4 Feb 2010 21:09] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions => 2.2.0.1614.
[5 Feb 2010 14:25] BitRock Merlin
Per Andy request the Agent installer should grant privileges for the Agent user using '%' and 'localhost'.
[5 Feb 2010 14:30] BitRock Merlin
Patch sent to Keith.
[11 Feb 2010 14:36] BitRock Merlin
Patch for the first and second issue sent to Keith.

1) Verifying Account Priviliges. Statement updated.

2) Warning, not error, if privileges are incorrect. If there is a connection error or the privileges are not correct, the installer will show a warning and continue the installation. This warning will be also added in the configuration report in the "Monitored Database" section.
[11 Feb 2010 18:09] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions => 2.2.0.1620.
[15 Feb 2010 15:52] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
using MySQL Enterprise Monitor Agent 2.2.0.1621 --- Built on 2010-02-12 22:54:20 IB: 6.2.7-201002080544 while the monitored DB was down the (unattended) install stopped with this error (nothing was installed):

Log started 02/15/2010 at 16:24:52
Preferred installation mode : unattended
Trying to init installer in mode unattended
Mode unattended successfully initialized
Preparing to Install
Creating Agent user account.
Executing /data0/merlin/agent/2.2.0.1621/openSUSE10.3-x86-64bit/qa-merlin/mysql/bin/mysql
MySQL connection failed: ***unknown variable program_stderr***
There has been an error.
MySQL connection failed: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[15 Feb 2010 18:55] BitRock Merlin
Hi,

We will fix this issue to the installer does not show the ***unknown variable program_stderr***.

Is the current behavior correct? Our understanding is the installer should show a warning if it fails *checking* the Agent account but it should thrown an error if it fails *creating* the Agent account.
[16 Feb 2010 14:34] BitRock Merlin
Patch sent to Keith. We have implemented the following changes:

1) During the Agent account check in or creation, the installer will only show warnings and it does not throw any error.
2) If the installer can not connect to the MySQL database it will show the following warnings:
 a) If the database is not running: "Could not connect to the MySQL server to create the account. You must create it by hand after installation."
 b) If the database is running but the root user/password is wrong: "Please enter the correct root user ID and password to create the agent account. If you decide to continue with the installation you will need to create the agent account by hand."
 c) If the database is running but the agent user/password is wrong: "Please enter the correct agent user ID and password to check the user privileges. If you decide to continue with the installation you will need to create the agent account by hand."

These messages are also added in the configuration report file. You can modify the wording of these messages in the language files.
[16 Feb 2010 16:46] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch pushed to the 2.2 installer repository.
[16 Feb 2010 23:28] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions => 2.2.0.1627.
[22 Mar 2010 11:27] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
OK in build 1652 (now the 2.2 docs are linked from the Aggr page)
[22 Mar 2010 11:37] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
the minor problem that still the 2.1 docs are linked from the "Monitored DB information" screen is tracked in the separate http://bugs.mysql.com/bug.php?id=52271 .
[27 May 2010 12:54] MC Brown
A note has been added to teh 2.2.0 changelog, and the documentation surrounding both attended and unattended installation has been updated to show the new options and functionality, and required changes to the installation sequence.