Bug #41603 Agent shuts down if privilege to mysql.inventory is not given
Submitted: 18 Dec 2008 21:48 Modified: 29 Jun 18:16
Reporter: Diego Medina
Status: Verified
Category:Monitoring: Agent Severity:S3 (Non-critical)
Version:2.0.2.7125 OS:Any
Assigned to: Kay Roepke Target Version:2.0 ASAP

[18 Dec 2008 21: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 21: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 17: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.