Automatic Agent signing

Good morning,

I’m writing Check_MK deployment automation for my company as we deploy for each client platform standalone Check_MK. I’ve almost everything written and working, however I can’t find a way of Signing Monitoring Agent via created key apart from GUI.

Can somebody tell me if there is any way of signing them after they’re baked from command line.

Thank you for all your help.

Signing the agent packages is currently a manual process and cannot be automated.

Thank you for the information.

This is not directly true, at least based on the version your using.
It’s a little bit complicated, but possible. At least at <=1.5.0.
The url you need to “call” looks similiar to this:

/check_mk/wato.py?sign=all&mode=agents&_do_sign=yes&key_p_key=%s&key_p_passphrase=%s&_transid=-1&_username=%s&_secret=%s" % (key_id, key_passphrase, wato_user, wato_pw)

The key_id needed to be look up once for each key at your site.
First pic the key you want to use for signing:
image
Then you need to examine the properties of the html-site and need to look for “key_p_key”.
image

If you have all information, then you can call the url above with the values and auto-sign your agents.
As soon as you change your signing-key, you need to look again for the changed key_id.

Greets

Oh my gosh !!! @Kruzgoth This is nuts !! You just saved me and my friends TONS of manual work.

Can I use automation user and automation secret ? I’m using 1.0.5p24

Yes of course you can :wink: the user only needs permission to register and sign agents.
Then it’s all done :stuck_out_tongue: