...
...
...
...
...
...
...
Info |
---|
Currently, there is no mechanism to sync piggyback files between a central and a remote site. |
To achieve this, please follow these steps:
Status |
---|
colour | Green |
---|
title | LAST TESTED ON CHECKMK 2.1.0P1 |
---|
|
Panel |
---|
borderColor | black |
---|
bgColor | #f8f8f8 |
---|
title | Table of Contents |
---|
|
|
Step-by-step guide
You need to sync ~/tmp/check_mk/piggyback/ and ~/tmp/check_mk/piggyback_sources/ to the remote site
- In ~/tmp/check_mk/piggyback all piggyback files are stored
- In ~/tmp/check_mk/piggyback_sources all piggyback sources are to be found
Without these files, the data will always be interpreted as outdated!
Info |
---|
- In case If you're using dcd connections, you should be aware that hosts could be created twice. To avoid this, you should use the restriction option inside the dcd connection paramatersparameters
- Please make sure that you modify your firewall configuration. Rsync needs the tcp TCP Port 873
|
There are, for sure several ways to create a small sync mechanism. We recommend using rsyc rsync. Here is a small script.
Info |
---|
In order to run the script regularly, you need to create cronjob |
Code Block |
---|
language | bash |
---|
collapsetheme | trueRDark |
---|
|
#!/usr/bin/env bash
#
# Written by: Anastasios Thomaidis - anastasios.thomaidis@tribe29.com -
on 20220207
#
# Purpose:
# This script allows you to sync piggyback files between the central and remote site
#
# Usage:
# ./piggyback_sync.sh -s $SOURCE -r $REMOTE -d
# The -d option will run rsync with --progress -h -vv to show more debug
while getopts s:r:h:d option;
do
case "$option" in
s) source_site=${OPTARG}
;;
r) remote_site=${OPTARG}
;;
d) debug='true'
;;
h) help='true'
;;
*) echo 'Unknown parameter!' && exit 1
;;
esac
done
# Variables
source_dir_piggyback_files="/omd/sites/$source_site/tmp/check_mk/piggyback/"
source_dir_piggyback_sources="/omd/sites/$remote_site/tmp/check_mk/piggyback_sources/"
remote_dir_piggyback_files="/omd/sites/$source_site/tmp/check_mk/piggyback/"
remote_dir_piggyback_sources="/omd/sites/$remote_site/tmp/check_mk/piggyback_sources/"
# Functions
help() {
echo -e "Syntax: -s source_site -r remote_site"
\n-d will run the script with rsync options --progress -h -vv to show more debug"
}
initialize() {
if [ -z "$source_site" ]
then
echo 'Source site missing!'
help
exit 1
fi
if [ -z "$remote_site" ]
then
echo 'Remote site missing!'
help
exit 1
fi
if [ "${debug}" == "true" ]
then
rsync_opts="--progress -h -vv"
else
rsync_opts="-q"
fi
}
sync() {
rsync -avzu --delete --progress -h${rsync_opts} "$source_dir_piggyback_files" "$remote_dir_piggyback_files"
rsync -avzu --delete --progress -h${rsync_opts} "$source_dir_piggyback_sources" "$remote_dir_piggyback_sources"
}
# Main
if [ "${help}" == "true" ]
then
help
exit 0
else
initialize
sync
fi
|
Info |
---|
To run the script regularly, you need to create a cronjob. |
Warning |
---|
Please keep in mind , that this not officially supported by tribe29Checkmk does not officially support this, and use it at your own risk! |
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 ( "fixme" , "distributed" , "howto" ) and type = "page" and space = "KB" |
---|
labels | fixme distributed |
---|
|
...