Hello @sho, hello @louis,
it seems that the commandline-option “protocol” was not correctly implemented in the current activemq-agent.
As seen in the source-code for the active_mq-agent (~/lib/check_mk/special_agents/agent_activemq.py
):
29 short_options = ""
30 long_options = ["piggyback", "servername=", "port=", "username=", "password="]
However, a few lines down, the protocol
-parameter is correctly parsed:
57 elif o in ['--protocol']:
58 opt_protocol = a
And if you don’t specify that parameter it defaults to http. But right now you don’t even reach that far in the code, as the agent aborts because it doesn’t recognize the protocol
parameter.
As @louis stated, the rule automatically adds the protocol
parameter, so you can’t configure the command line in a way, that it doesn’t send the protocol
parameter.
A quick fix would be to add the protocol
parameter to the /opt/omd/versions/XXXX/lib/check_mk/special_agents/agent_activemq.py
on line 30 as such:
30 long_options = ["piggyback", "servername=", "port=", "username=", "password=", "protocol="]
In version 1.6 and below i would just say copy the agent to the ~/local
hierarchy, make the changes there and checkmk should use the corrected agent.
But in 2.0 they changed the folder-structure and internals quite heavily, so in my quick testing that did not work.
If you however need a quick fix, you could do the following but be aware, that this is not update safe and would apply to all sites on your monitoring server!
- As root make a backup of the special-agent (change the version accordingly):
cp /opt/omd/versions/2.0.0p3.cre/lib/check_mk/special_agents/agent_activemq.py /opt/omd/versions/2.0.0p3.cre/lib/check_mk/special_agents/agent_activemq.py.bak
- And then (also as root) add the above mentioned parameter in line 30 to
/opt/omd/versions/2.0.0p3.cre/lib/check_mk/special_agents/agent_activemq.py
After a cmk -R
the agent should now recognize the protocol
parameter.
Again, this would be a quick and dirty fix, please make a backup of the original file if you try this, but i hope this helps.
If anyone knows how the ~/local
hierarchy works with 2.0 for modifying the built-in files, please let me know!
Cheers,
Lorenz