Where to place the special agent on 2.3?

Hi,

I try to rewrite a own developed 2.1 plugin to 2.3. Thanks to Andreas Redfish source, I can migrate the ruleset und the server_side parts. When try a discovery, CheckMK cannot find the special agent for this plugin.
I put my special agent under “cmk_addons/plugins/solidfire/special_agents/”

Is this path correct? Or is there another path to put the special agent into?

Hi,

yes, this is correct.
There are two pitfalls I ran into :

  1. The file name of the special agent has to match the name in ther server_side_call specification with agent_ prefixed and the .py extension.
    So if the name is solidfire you need agent_solidfire.py
  2. For changed rulesets you need at least to reload the site apache or do an omd restart

Thx Andre,

The ruleset is working. Thats not the problem.
This is my server_side_call code:

special_agent_solidfire = SpecialAgentConfig(
    name="solidfire",
    parameter_parser=SolidfireParams.model_validate,
    commands_function=solidfire_arguments,
)

And the special agent is located in “cmk_addons/plugins/solidfire/special_agents/” with the name “agent_solidfire.py”

Why do special agents have to be implemented in Python (or at least have the .py filename extension), @moritz?

Maybe i´m wrong, but that was the only way it worked for me :slight_smile:

They shouldn’t have to; that would be a bug. But I just checked with agent_fritzbox (checkmk/cmk/plugins/fritzbox/libexec/agent_fritzbox at master · Checkmk/checkmk · GitHub) , and that seems to work fine for me.

I was try several things, but CheckMK cannot find the Special_Agent.
Do I have to “register” the agent itself? I was hoping I can reuse the old python special agent.

There is no error when execute ‘cmk-update-config’
The error message in the CheckMK GUI:
‘[special_solidfire]: Program ‘agent_solidfire’ not found (exit code 127)’

Is there a logfile I can take a deeper look into?

Thanks so much.

Important a two files - one inside “libexec” folder and the special agent itself inside “special_agents”.
The “server_side_calls” files must also be in the right syntax.
My Redfish package you can use as an example.

If only the call of the special agent is the problem then you should solve it with the information from this package.

1 Like

Many thanks Andreas. That was the missing piece of the puzzle. Now CheckMK also recognizes my Special Agent.
I saw the libexec directory in your Redfish plugin, but thought it was something special that I didn’t need myself.

1 Like

I have a (probably stupid) question about this: Why the “detour” via the libexec folder?
The files in there call the special agent in “special_agent”-folder. Can’t the special agent be placed directly in the libexec folder?