MEM with missing Agents?
By Jonathon Coombes on Apr 05, 2009
You have just downloaded and installed MySQL Enterprise Monitor and have started it up to find that there are no detected MySQL installs. You know you run MySQL servers, so what is the problem?
Each MySQL database server has an associated agent process that run on it to gather information and report back to the central monitoring service. There is a heartbeat that keeps track of all the different agents and reports if there is any trouble e.g. the service is down. This is known as the heartbeat.
So even after setting up the monitor and the associated agents, why are they not showing up in the dashboard as you expect? The agents are running, the mysqld process is running, everything should be working just fine!?
Well, what is usually not realised here, is that MEM actually uses the curl library to manage it's information transfer between the monitor and the agents. This is usually not a concern unless you have a corporate proxy based on using environment variables http_proxy and no_proxy.
Curl has a method of managing proxies using and environment variable setting. To define a proxy, you use something like:
$ setenv http_proxy company_proxy.com:8080
This means that all applications that understand this method of defining proxies (including Curl), will attempt to use company_proxy.com to communicate to other uri's.
In setting up the corporate proxy policy, many may simply define the http_proxy setting on all machines in the corporate network. This makes for a fast and simple setup, but can lead to problems in MEM in terms of heartbeat.
The heartbeat that MEM uses is attempting a http connection which uses the curl library to attempt the connection. The curl library detects that you have http_proxy set in the environment and so attempts the connection through the proxy, which causes authentication issues to MEM. The problem is often amplified when using more specialised ports for the proxy other than the standard http port.
Luckily, Curl allows a way of bypassing the proxy as well using the no_proxy environment variable. To allow the MEM agent to function as expected, we can bypass the proxy using:
$ setenv no_proxy 127.0.0.1,192.168.0.10
When MEM initiates a heartbeat now through the curl library, it knows that it does not use the proxy for the localhost or the ip address defined. This allows MEM to happily send out heartbeats and work without issue on the proxy authentication.