Bug #53981 MEM agent is giving unknown option errors on --agent* options
Submitted: 26 May 2010 7:03 Modified: 20 Jan 2016 14:40
Reporter: Jonathon Coombes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.2.0.1705 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: Agent, mem, Merlin

[26 May 2010 7:03] Jonathon Coombes
Description:
After installing the latest agent (mysqlmonitoragent-2.2.0.1705-windows-installer.exe) and trying to see the options with --help-all, the --agent* options were not listed.

Checking the same version on Linux and Mac OS X showed no similar issue.

Trying to run the agent with the options gave errors as:

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --agent-mgmt-username=test
2010-05-26 11:03:59: (critical) .\mysql-proxy-cli.c:464: Unknown option --agent-mgmt-username=test (use --help to show all options)

All this worked in previous versions for Microsoft Windows platforms?

There also appears to be some parsing issue with the paths under Windows:

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --plugin-dir="C:\Program Files (x86)\MySQL\Enterprise\Agent\bin" --agent-mgmt-username=tes
2010-05-26 11:10:31: (critical) .\mysql-proxy-cli.c:464: Unknown option --agent-mgmt-username=tes (use --help to show all options)

The we add a trailing backslash to the plugin-dir path as:

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --plugin-dir="C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\" --agent-mgmt-username=tes
2010-05-26 11:10:40: (critical) loading module 'C:\Program Files (x86)\MySQL\Enterprise\Agent\bin" --agent-mgmt-username=tes\plugin-admin.dll' failed: `C:\Program Files (x86)\MySQL\Enterprise\Agent\bin" --agent-mgmt-username=tes\plugin-admin.dll': The specified module could not be found.

Another strange parsing example:

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --plugin-dir="bin\ --all-help
2010-05-26 12:49:21: (critical) loading module 'C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ --all-help\plugin-admin.dll' failed: `C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ --all-help\plugin-admin.dll': The specified module could not be found.

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --all-help --plugin-dir="bin\
2010-05-26 12:49:44: (critical) loading module 'C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ \plugin-admin.dll' failed: `C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ \plugin-admin.dll': The specified module could not be found.

Not sure if the parsing is related to the plugin issue or not.

How to repeat:
Install the mysqlmonitoragent-2.2.0.1705-windows-installer.exe and try to run the agent from the command line using --agent* options.

Try and see the --agent* options using:

> mysql-monitor-agent.exe --help-all

Suggested fix:
C:\Program Files\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --plugins=agent --help-all

This seems to be a workaround, but the --plugins option is not required in other platforms and seems to be a new requirement in this latest version for Windows?
[26 May 2010 7:13] Roel Van de Paar
Verified as described. Paths parsing is odd.

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --plugin-dir="bin\ --help-all
2010-05-26 17:09:24: (critical) loading module 'C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ --help-all\plugin-admin.dll' failed: `C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ --help-all\plugin-admin.dll': The specified module could not be found.

C:\Program Files (x86)\MySQL\Enterprise\Agent\bin>mysql-monitor-agent.exe --help-all --plugin-dir="bin\
2010-05-26 17:09:37: (critical) loading module 'C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ \plugin-admin.dll' failed: `C:\Program Files (x86)\MySQL\Enterprise\Agent\bin\ \plugin-admin.dll': The specified module could not be found.

Also, in both cases above the agent crashes immediately.
[27 May 2010 16:01] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
1) Just to clarify the command-line handling if non-closed quotes: 

* THIS IS WINDOWS !

Read that again. That is the cmd.exe and that's how it handles quotes. 

2) If you use paths in the config, use forward slashes. Backslashes are escape-characters in the command-line handling (should be in our docs) and need to be escaped like \\

3) On the --help-all not working. It should work, it is a bug if it doesn't.
[20 Jan 2016 14:40] Mark Leith
Closing, this 2.x agent is no longer supported.