Agent bakery: How to force the bakery to bake a agent?

CMK version:2.0.0p26
OS version:RHEL 8

Problem:Agent will not be baked after rule changes

Hello all

How is it possible to force the Bakery to bake a agent?
I changed rule after rule for that specific host but the new agent will not be baked.
Is there a way to force that?

Thank’s

Regards
JP

Hi @JPH ,
if the bakery will not bake an agent, the “rules” normaly do not need to be pushed to the agent.
Only parts that will run local on the client will be baked into the agent.

Or do you mean, that the bakery have to automaticly bake an agent with any rule change?
That will not happen, you have to do it by your self with the bake and sign button.

2 Likes

Hallo,
normally if the button is now highlighted nothing changed that needed a new agent.
A simple way is to use a „dummy“ rule, change something trivial and baking should be possible,
A force button may be a content for a feature request.
Ralf

1 Like

I might be stating the obvious here, but there is no need for a “Force agent baking” button.
The bakery already handles the baking in a smart and efficient way, ensuring all agent packages are up-to-date, while keeping a low resource profile.

Simply put: If the bakery does not bake a new agent configuration for a host, then no new rules apply.

May you can tell which rules you changed?
If you just changed a level for a certain check it will not create a change on an agent.
New agents are only baked if a agent plugin is added/removed or a agent/agent plugin configuration has changed.

regards

MF

Hi Mike

I just changed the fileinfo sections and logwatch parts for that host and made some comments.
But the agent was not baked.

So the changes were not recognized from the Bakery and the need for a “bake agent for host xy button” is more than ok because the Bakery does not recognize the changes of custom files and in some situations needs a quick agent bake to test something for specific host/s.

Thanks
Regards
JP

Personal opinion here: I find it remarkable, how you jump to conclusions @JPH. There is not even a hint in your writing, that there might be an error on your end. It has to be the software. Please keep an open mind and assume you could have made an error yourself from time to time.


Professional opinion: The agent bakery works very efficiently as already said. So if you only changed rules addressing one host, only that agent configuration will be touched. So there is no reason to bake a single agent configuration.
As no proof has been provided towards the claims, that the agent bakery ignores rules, the only possible assumption at this point is, that there is a configuration error.

Agent baking could be forced and debugged on CLI with cmk -A. or with the button “Bake agents” but only if you change a bakery rule you will get a new hash and a new agent is baked.
So if you changed something in the rule “Text logfiles (Linux, Windows)” your button ‘agent’ becomes highlighted. If you now bake new agents you will have a new hash for the new agent package:

Before modification:

** After Modification**

Funny enough if you change the configuration back to what it was before you get the exact same hash as the configuration had initially. That´s perfect because then no new agent is rolled out in case you made a mistake and need to roll back. In an environment with tens of thousands of hosts it would be a nightmare.

If the agent bakery doesnt detect a change, it will not generate a new hash and therefor also enforcing a baking process will not have any benefit because no new agent package is baked.
I run a big environment and have so far big no issues with Agent bakery.
The only bad situation until 1.6 is if you change the code of an agent plugin there will be no new hash generated. This should be fixed in 2.0.
Inconvenient is if you add a new host with an agent configuration which has an already baked agent you need to re-bake to assign the baked agent to the host. We have since long a patch for to automatize this but it never made it in the official code.

BR

MF

1 Like

Maybe it is is a realy good hint from robin to proof, if the changes are targeting to your agent.
I have done this mistake a lot of time myself :wink:

1 Like

After some rule changes an bakings the host with one specific agent has got a new agent from the bakery. And now the hash was changed. I’ve to be more patient with the Bakery and give her more time to recogize my changes. The old lady just need some more time and some more changes.

Thanks for your help and infos!
regrads
JP

1 Like

I cannot permit trash talk toward elderly people: If the agent bakery was an old lady, someone might have gotten slapped with a purse.

My point is however, that the agent bakery is hardly an old lady. If rules apply, they will be instantly picked up and considered for the agent configuration. If the agent configuration did not change, no rules applied. It is that easy.

*drops mic*

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.