added file dependency check, switched back to english, smaller fix and improvements

This commit is contained in:
fatalerrors
2021-11-18 14:53:11 +01:00
parent 9fc9b96165
commit b71a0c2ee8
21 changed files with 360 additions and 173 deletions

View File

@@ -12,28 +12,39 @@
# * MK_PORT: Port check_mk agent will use to communicate with server
# ------------------------------------------------------------------------------
export VER_install_mkagent="0.0.2"
export VER_install_mkagent="0.0.4"
export DEP_install_mkagent="upgrade_dist install_pkg"
install_mkagent()
{
pkginst $MYPATH/repo/mk_agents/check-mk-agent_${MKVERSION}_all.deb
wget $MK_URL -O /tmp/check-mk-agent_${MK_VERSION}_all.deb
pkginst xinetd /tmp/check-mk-agent_${MK_VERSION}_all.deb
rm /tmp/check-mk-agent_${MK_VERSION}_all.deb
backupdist /etc/xinetd.d/check_mk
installfile check_mk /etc/xinetd.d/check_mk
sed -i -e "s/@MK_SERVER@/$MK_SERVER/" /etc/xinetd.d/check_mk
installfile cmk/check_mk /etc/xinetd.d/check_mk
mkdir -pv /usr/lib/check_mk_agent/plugins/28800
installfile cmk/mk_apt /usr/lib/check_mk_agent/plugins/28800/mk_apt
sed -i -e "s/@MK_SERVER_IP@/$MK_SERVER_IP/" /etc/xinetd.d/check_mk
svc_restart xinetd
}
precheck_install_mkagent()
{
if [[ -n $MKVERSION ]]; then
if [[ -z $MK_VERSION ]]; then
prnt E "Undeclared check_mk version of the agent to install."
die 162
fi
if [[ -n $MK_SERVER ]]; then
if [[ -z $MK_URL ]]; then
prnt E "Undeclared check_mk download URL."
die 162
fi
if [[ -z $MK_SERVER_IP ]]; then
prnt E "Undeclared check_mk server."
die 162
fi
file_exists cmk/check_mk cmk/mk_apt
}
export -f install_mkagent