How-to: Automatic install, update and remove checkmk-agent on Linux and Windows

Hello everyone,
I want to share my small scripts with all of you on how to automatically install, update and remove the checkmk-agent on linux or windows machines.

https://github.com/SuitDeer/checkmk-agent-script

5 Likes

Little comment:

The Linux code only supports Debian-style ( *.deb) linux hosts.
As there are more types of linux out there i suggest you extend your script to compensate for this.
My suggestion would be to revolve the decision which package-manager is installed/used around the /etc/os-release information.

Also in regards of structure:

  • define/set customer/site specific items on top.
    as in :
# parameters needed to be set site-specific.
SERVER_NAME="v-u-checkmk-p"
SITE_NAME="cmk"
API_URL="http://$SERVER_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="automation" 
PASSWORD="<PASSWORD_OF_THE_AUTOMATION_USER>"
# End specific parameters
##### below should not be changed unless you are absolutely sure in what you are doing !

.. rest of the code...
  • Glowsome

Thanks for the info :+1:
I have modified the scripts to detect if dpkg or rpm package manager is installed and accordingly install the correct checkmk agent on a linux system