Bug #41603 Agent shuts down if privilege to mysql.inventory is not given
Submitted: 18 Dec 2008 20:48 Modified: 25 May 2010 16:23
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.0.2.7125 OS:Any
Assigned to: MEM Agent Devs CPU Architecture:Any

[18 Dec 2008 20:48] Diego Medina
Description:
If the user that the agent is using to monitor a mysqld instance does not have the SELECT privilege on the mysql.inventory table, it will crash and then it will come back thanks to the angel.

It should really not crash, and just gracefully shutdown

This bug is related to http://bugs.mysql.com/bug.php?id=41600

How to repeat:
1- create a user on your mysql server that does not have the select privilege on the mysql.inventory table

mysql> GRANT INSERT, CREATE ON `mysql`.* TO 'agent_test'@'localhost' IDENTIFIED BY 'mysql';

2- Install the agent and service manager (Use the 'agent_test' username during the agent install

3- Add this line to the mysql-monitor-agent.ini file
log-level=debug
4- start the agent and monitor the agent's log. You will see messages like:

2008-12-18 15:43:12: (message) chassis.c:304: [angel] PID=1742 died on signal=6 (it used 2800 kBytes max) ... waiting 3min before restart

Suggested fix:
Gracefully shutdown if the agent does not have enough privileges to the mysql.inventory table
[24 Feb 2009 20:32] Diego Medina
Changed summary/description because the agent does not crash any more, but it shuts down and adds many times the same logs
[23 Oct 2009 15:59] Enterprise Tools JIRA Robot
Mark Leith writes: 
We should of course only log to the agent's error log, and not shut down the entire process. 

We would also still like to be able to log these kinds of messages in to the service manager as well however, so that they can be reported on centrally. 

Priority for this issue is to not shut down the agent and only log to the agent log however.