...
Panel |
---|
borderColor | black |
---|
bgColor | #f8f8f8 |
---|
title | Table of Contents |
---|
|
|
Step-by-step guide
Prerequisites
- A user with sufficient rights (the automation user would do out of the box)
- Checkmk's server hostname (or IP)
- The site which holds the agent
- The agent you want to download (i.e., OS & hash or hostname)
...
Code Block |
---|
|
root@linux# su - mysite
OMD[mysite]:~$ ls var/check_mk/agents/linux_deb/packages/
1ae46a9ab42f290b 1ae46a9ab42f290b.conf 1ae46a9ab42f290b.sig 8107877152463cf2 8107877152463cf2.conf 8107877152463cf2.sig |
Download via REST API
httpie (recommended)
Install httpie on the system where you want to download the agent.
Download by hash value
The following is an example script, that you can use to download the agent.
Code Block |
---|
|
#!/bin/bash
HOST_NAME="$MYCHECKMKSERVER"
SITE_NAME="$MYSITE"
API_URL="http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="$AUTOMATION_USER"
PASSWORD="$AUTOMATION_SECRET"
http --json GET "$API_URL/domain-types/agent/actions/download_by_hash/invoke" \
"Authorization: Bearer $USERNAME $PASSWORD" \
"Accept: application/octet-stream" \
agent_hash=="<hash<"\
os_type=="linux_deb" \
--download |
Download by hostname
The following is an example script, that you can use to download the agent.
Code Block |
---|
|
#!/bin/bash
HOST_NAME="$MYCHECKMKSERVER"
SITE_NAME="$MYSITE"
API_URL="http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="$AUTOMATION_USER"
PASSWORD="$AUTOMATION_SECRET"
http --json GET "$API_URL/domain-types/agent/actions/download_by_host/invoke" \
"Authorization: Bearer $USERNAME $PASSWORD" \
"Accept: application/octet-stream" \
host_name=="localhost"\
os_type=="linux_deb" \
--download |
curl
Download by hash value
The following is an example script, that you can use to download the agent.
Code Block |
---|
|
#!/bin/bash
HOST_NAME="$MYCHECKMKSERVER"
SITE_NAME="$MYSITE"
API_URL="http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="$AUTOMATION_USER"
PASSWORD="$AUTOMATION_SECRET"
curl \
-G \
--request GET \
--write-out "\nxxx-status_code=%{http_code}\n" \
--header "Authorization: Bearer $USERNAME $PASSWORD" \
--header "Accept: application/octet-stream" \
--data-urlencode 'agent_type=host_name' \
--data-urlencode 'host_name=local' \
--data-urlencode 'os_type=linux_tgz' \
-o myagent.tgz \
"$API_URL/domain-types/agent/actions/download_by_host/invoke" |
Download by hostname
The following is an example script, that you can use to download the agent.
Code Block |
---|
|
#!/bin/bash
HOST_NAME="$MYCHECKMKSERVER"
SITE_NAME="$MYSITE"
API_URL="http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="$AUTOMATION_USER"
PASSWORD="$AUTOMATION_SECRET"
curl \
-G \
--request GET \
--write-out "\nxxx-status_code=%{http_code}\n" \
--header "Authorization: Bearer $USERNAME $PASSWORD" \
--header "Accept: application/octet-stream" \
--data-urlencode 'agent_type=host_name' \
--data-urlencode 'host_name=local' \
--data-urlencode 'os_type=linux_tgz' \
-o myagent.tgz \
"$API_URL/domain-types/agent/actions/download_by_host/invoke" |
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | KB |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label in ( "kb-how-to-article" , "howto" , "agent_bakery" ) and type = "page" and space = "KB" |
---|
labels | kb-how-to-article |
---|
|
...