Bug #41590 config errors that prevent agent from starting do not output to screen
Submitted: 18 Dec 2008 13:34 Modified: 19 Dec 2008 8:46
Reporter: Eric Herman
Status: Verified
Category:Monitoring: Agent Severity:S3 (Non-critical)
Version:2.0.1.7125 OS:Any
Assigned to: Jan Kneschke Target Version:2.0 maint release

[18 Dec 2008 13:34] Eric Herman
Description:
If there is something misconfigured in the agent's ini file, the agent doesn't start. It
logs the issue, but nothing is sent to stderr.

This is especially confusing if one of the config problems is the log file location.

How to repeat:
(1) edit log-level to be something wrong:
halle:monitor2-agent eric$ grep log-level ./etc/mysql-monitor-agent.ini
#log-level = debug
log-level = DEBUG

(2) start the agent:
halle:monitor2-agent eric$ /Users/eric/builds/mysql-lb/sbin/mysql-monitor-agent   
--defaults-file=/Users/eric/mworkspace/monitor2-agent/etc/mysql-monitor-agent.ini   
--proxy-address=127.0.0.1:24140    --admin-address=127.0.0.1:24142    2>&1 &>
/Users/eric/mworkspace/monitor2-agent/log.log 
halle:monitor2-agent eric$

(3) observe there are no errors to the screen; yet the agent did not start:
halle:monitor2-agent eric$ ps auxwww | grep "PID\|monitor-agent" | grep -v grepUSER      
PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
halle:monitor2-agent eric$

(4) tail the log file to see there was an immediate problem:
halle:monitor2-agent eric$ tail log.log 2008-12-18 13:26:26: (critical) --log-level=...
failed, level 'DEBUG' is unknown 2008-12-18 13:26:26: (message) shutting down normally
halle:monitor2-agent eric$ 

Suggested fix:
print critical initialization issues to stderr