1
0
mirror of https://github.com/limosek/zaf.git synced 2025-11-01 10:07:38 +01:00

Repaired zabbix auto installation

This commit is contained in:
Lukas Macura
2016-04-04 10:27:25 +02:00
parent 99bd255e3f
commit 8188fdba93
3 changed files with 30 additions and 12 deletions

View File

@@ -101,22 +101,31 @@ zaf_uninstall(){
# Automaticaly install agent on debian
# For another os, create similar function (install_zabbix_centos)
zaf_install_agent_debian() {
zaf_fetch_url "http://repo.zabbix.com/zabbix/3.0/debian/pool/main/z/zabbix-release/zabbix-release_3.0-1+${ZAF_CODENAME}_all.deb" >"/tmp/zaf-installer/zabbix-release_3.0-1+${ZAF_CODENAME}_all.deb" \
&& dpkg -i "/tmp/zaf-installer/zabbix-release_3.0-1+${ZAF_CODENAME}_all.deb" \
zaf_fetch_url "http://repo.zabbix.com/zabbix/3.0/debian/pool/main/z/zabbix-release/zabbix-release_3.0-1+${ZAF_OS_CODENAME}_all.deb" >"/tmp/zaf-installer/zabbix-release_3.0-1+${ZAF_OS_CODENAME}_all.deb" \
&& dpkg -i "/tmp/zaf-installer/zabbix-release_3.0-1+${ZAF_OS_CODENAME}_all.deb" \
&& apt-get update \
&& apt-get install $ZAF_AGENT_PKG
&& apt-get install -y -q $ZAF_AGENT_PKG
}
zaf_install_agent_opkg() {
opkg update && \
opkg install $ZAF_AGENT_PKG
}
# Check if dpkg dependency is met
# $* - packages
zaf_check_deps_dpkg() {
dpkg-query -f '${Package}\n' -W $* >/dev/null
for i in $*; do
dpkg-query -f '${Status},${Package}\n' -W $* 2>/dev/null | grep -q "^install ok"
done
}
# Check if dpkg dependency is met
# $* - packages
zaf_check_deps_rpm() {
rpm --quiet -qi $*
for i in $*; do
rpm --quiet -qi $i | grep -q $i
done
}
# Check if dpkg dependency is met

View File

@@ -9,13 +9,13 @@ zaf_msg() {
echo $@
}
zaf_dbg() {
[ "$ZAF_DEBUG" -ge "2" ] && logger -s -t zaf $@
[ "$ZAF_DEBUG" -ge "2" ] && logger -s -t zaf -- $@
}
zaf_wrn() {
[ "$ZAF_DEBUG" -ge "1" ] && logger -s -t zaf $@
[ "$ZAF_DEBUG" -ge "1" ] && logger -s -t zaf -- $@
}
zaf_err() {
logger -s -t zaf $@
logger -s -t zaf -- $@
logger -s -t zaf "Exiting with error!"
exit 1
}
@@ -40,7 +40,7 @@ zaf_fetch_url() {
case $scheme in
http|https|ftp|file)
[ "${ZAF_CURL_INSECURE}" = "1" ] && insecure="-k"
zaf_msg curl $insecure -f -s -L -o - "$1"
zaf_dbg curl $insecure -f -s -L -o - $1
curl $insecure -f -s -L -o - "$1"
;;
esac