forked from Checkmk/checkmk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, some scripts did not find or even used the wrong (obsolete) .site file, this has been fixed. Furthermore, *all* .f12 scripts now start with the same (modulo path) few lines, calculating SITE and ROOT. Change-Id: I159ab92b60fe03c557cdb70bf4945297dd1704df
- Loading branch information
Sven Panne
committed
Sep 14, 2017
1 parent
d7eae2c
commit 8c55775
Showing
35 changed files
with
234 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#!/bin/bash | ||
SITE=${SITE:-$(cat .site || true)} | ||
set -e | ||
|
||
SITE=${SITE:-$(cat .site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sed -e "s#@BINDIR@#/omd/sites/$SITE/bin#g" \ | ||
-e "s#@VARDIR@#/omd/sites/$SITE/var/check_mk#g" \ | ||
-e "s#@CHECK_ICMP@#/omd/sites/$SITE/lib/nagios/plugins/check_icmp#g" \ | ||
ROOT=/omd/sites/$SITE | ||
|
||
sed -e "s#@BINDIR@#$ROOT/bin#g" \ | ||
-e "s#@VARDIR@#$ROOT/var/check_mk#g" \ | ||
-e "s#@CHECK_ICMP@#$ROOT/lib/nagios/plugins/check_icmp#g" \ | ||
-e "s#@PNPURL@#/$SITE/pnp4nagios/#g" \ | ||
-e "s#@CGIURL@#/$SITE/nagios/cgi-bin#g" \ | ||
< check_mk_templates.cfg > /tmp/check_mk_templates.cfg | ||
|
||
sudo mv /tmp/check_mk_templates.cfg /omd/sites/$SITE/etc/nagios/conf.d | ||
sudo mv /tmp/check_mk_templates.cfg $ROOT/etc/nagios/conf.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
# sudo mkdir -p /usr/lib/check_mk_agent/plugins | ||
# sudo install -m 755 * /usr/lib/check_mk_agent/plugins || true | ||
sudo rsync -va --exclude=.f12 ./ /omd/sites/$SITE/share/check_mk/agents/plugins/ | ||
sudo rsync -va --exclude=.f12 ./ $ROOT/share/check_mk/agents/plugins/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo cp agent_* /omd/sites/$SITE/share/check_mk/agents/special/ | ||
sudo cp lib/cmk_special_agent_api.py /omd/sites/$SITE/lib/python/ | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo cp agent_* $ROOT/share/check_mk/agents/special/ | ||
sudo cp lib/cmk_special_agent_api.py $ROOT/lib/python/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
make || true | ||
sudo rsync -varx -v CONTENTS *.exe /omd/sites/$SITE/share/check_mk/agents/windows/ | ||
sudo rsync -varx -v CONTENTS *.exe $ROOT/share/check_mk/agents/windows/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/bash | ||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo cp -p msi-update /omd/sites/$SITE/bin | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo cp -p msi-update $ROOT/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo install -m 755 * /omd/sites/$SITE/share/check_mk/agents/windows/plugins | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo install -m 755 * $ROOT/share/check_mk/agents/windows/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo rsync -var --delete ./ /omd/sites/$SITE/share/check_mk/checkman/ | ||
sudo rm -f /omd/sites/$SITE/share/check_mk/checkman/.f12 | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo rsync -var --delete ./ $ROOT/share/check_mk/checkman/ | ||
sudo rm -f $ROOT/share/check_mk/checkman/.f12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
echo "TARGET: /omd/sites/$SITE/share/check_mk/checks" | ||
sudo rsync -ar --delete-after ./ /omd/sites/$SITE/share/check_mk/checks/ | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo "TARGET: $ROOT/share/check_mk/checks" | ||
sudo rsync -ar --delete-after ./ $ROOT/share/check_mk/checks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
OMD_ROOT=/omd/sites/${SITE} | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo rsync \ | ||
--exclude=cee \ | ||
--exclude=cee.py \ | ||
-a * $OMD_ROOT/lib/python/cmk_base/ | ||
sudo pycompile -q $OMD_ROOT/lib/python/cmk_base/cmk_base | ||
echo "Installed to $OMD_ROOT/lib/python/cmk_base/" | ||
-a * $ROOT/lib/python/cmk_base/ | ||
sudo pycompile -q $ROOT/lib/python/cmk_base/cmk_base | ||
echo "Installed to $ROOT/lib/python/cmk_base/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/bash | ||
# man -l check_mk.1 >/dev/tty </dev/tty | ||
# exit | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
echo "TARGET: /omd/sites/$SITE/share/check_mk/checks" | ||
sudo rsync -ar --delete-after ./ /omd/sites/$SITE/share/doc/check_mk/ | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo "TARGET: $ROOT/share/check_mk/checks" | ||
sudo rsync -ar --delete-after ./ $ROOT/share/doc/check_mk/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo install -m 755 guitest /omd/sites/$SITE/bin/guitest | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo install -m 755 guitest $ROOT/bin/guitest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
echo "TARGET: /omd/sites/$SITE/share/check_mk/checks" | ||
sudo rsync -var ./ /omd/sites/$SITE/local/share/check_mk/checks/ | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo "TARGET: $ROOT/share/check_mk/checks" | ||
sudo rsync -var ./ $ROOT/local/share/check_mk/checks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
echo "TARGET: /omd/sites/$SITE/share/check_mk/inventory" | ||
sudo rsync -ar --delete-after ./ /omd/sites/$SITE/share/check_mk/inventory/ | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo "TARGET: $ROOT/share/check_mk/inventory" | ||
sudo rsync -ar --delete-after ./ $ROOT/share/check_mk/inventory/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
OMD_ROOT=/omd/sites/${SITE} | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo rsync -a *.py $OMD_ROOT/lib/python/cmk/ | ||
sudo pycompile -q $OMD_ROOT/lib/python/cmk/ | ||
echo "Installed to $OMD_ROOT/lib/python/cmk/" | ||
sudo rsync -a *.py $ROOT/lib/python/cmk/ | ||
sudo pycompile -q $ROOT/lib/python/cmk/ | ||
echo "Installed to $ROOT/lib/python/cmk/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
SITE=${SITE:-$(cat ../.site)} | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
sudo mkdir -p /omd/sites/$SITE/share/check_mk/notifications | ||
sudo cp -vp * /omd/sites/$SITE/share/check_mk/notifications | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo mkdir -p $ROOT/share/check_mk/notifications | ||
sudo cp -vp * $ROOT/share/check_mk/notifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
SITE=${SITE:-$(cat ../../.site || true)} | ||
#!/bin/bash | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo "Installing to site \"$SITE\"..." | ||
sudo install -m 755 diskspace /omd/sites/$SITE/bin | ||
sudo install -m 755 merge-crontabs /omd/sites/$SITE/bin | ||
sudo install -m 755 diskspace $ROOT/bin | ||
sudo install -m 755 merge-crontabs $ROOT/bin | ||
for F in ../*/diskspace; do | ||
sudo cp $F /omd/sites/$SITE/share/diskspace | ||
sudo cp $F $ROOT/share/diskspace | ||
done | ||
|
||
sudo cp skel/etc/cron.d/* /omd/sites/$SITE/etc/cron.d | ||
sudo cp skel/etc/cron.d/* $ROOT/etc/cron.d | ||
sudo omd restart $SITE crontab | ||
|
||
sudo omd restart $SITE apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/bin/bash -e | ||
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)} | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
echo '#define OMD_VERSION "$(omd versions | grep default | cut -d' ' -f1)"' > mod_python-*/src/omd_version.h | ||
make -C mod_python-* clean all | ||
sudo make install OMD_ROOT=/omd/sites/$SITE | ||
sudo make install OMD_ROOT=$ROOT | ||
sudo omd restart $SITE apache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#!/bin/bash | ||
sudo install -v -m 755 merge-nagios-config /omd/versions/default/bin/merge-nagios-config | ||
set -e | ||
|
||
SITE=${SITE:-$(cat ../../../.site 2>/dev/null || true)} | ||
SITE=${SITE:-$(omd sites --bare | head -n 1)} | ||
ROOT=/omd/sites/$SITE | ||
|
||
sudo install -v -m 755 merge-nagios-config /omd/versions/default/bin/merge-nagios-config | ||
sudo install -s -v -m 755 nagios-*.*.*/base/nagios /omd/versions/default/bin/nagios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.