New package management

Repaired install
Added external item support
This commit is contained in:
Lukas Macura
2016-06-17 11:58:43 +02:00
parent 3ad71262e2
commit 93b482dc69
17 changed files with 368 additions and 127 deletions
+5
View File
@@ -0,0 +1,5 @@
PACKAGE (1.0) zaf; urgency=medium
* Initial release.
-- Lukas Macura <lukas@macura.cz> Wed, 06 Apr 2016 13:56:25 +0200
+11
View File
@@ -0,0 +1,11 @@
Package: zaf
Version: {ZAF_VERSION}
Homepage: https://github.com/limosek/zaf
Section: admin
Priority: optional
Architecture: all
Depends: dash, awk, sed, grep, coreutils {ZAF_DEPENDS}
Maintainer: Lukas Macura <lukas@macura.cz>
Description: Zabbix agent framework package
This tool is used to maintain external zabbix checks in one place. Primary goal is not to make all plugins available here but to be able to use any plugin and decentralized development. If you are maintainer of some external check, it is enough to create zaf file in your repo and use zaf installer everywhere.
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
case $1 in
configure)
if [ -f /usr/lib/zaf/install.sh ] && [ -f /etc/zaf.conf ] && [ -f /usr/lib/zaf/zaf.lib.sh ] && which zaf >/dev/null; then
. /etc/zaf.conf
. /usr/lib/zaf/zaf.lib.sh
. /usr/lib/zaf/os.lib.sh
. /usr/lib/zaf/ctrl.lib.sh
cd /usr/lib/zaf && /usr/lib/zaf/install.sh reconf
[ -n "{PLUGINS}" ] && zaf reinstall {PLUGINS} {IPLUGINS}
fi
;;
esac
true
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
case $1 in
install)
if [ -d /usr/lib/zaf ]; then
echo "Do zaf self-remove first! Cannot mix packaged and non-packaged version!"
exit 2
fi
;;
esac
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
case $1 in
remove)
rm -rf /usr/lib/zaf/plugins /usr/lib/zaf/repo
;;
esac
+12
View File
@@ -0,0 +1,12 @@
ZAF_PKG='dpkg'
ZAF_AGENT_PKG='zabbix-agent'
ZAF_TMP_BASE='/tmp/zaf'
ZAF_LIB_DIR='/usr/lib/zaf'
ZAF_BIN_DIR='/usr/bin'
ZAF_PLUGINS_DIR='/usr/lib/zaf/plugins'
ZAF_PLUGINS_URL='https://raw.githubusercontent.com/limosek/zaf-plugins/master/'
ZAF_PLUGINS_GITURL='https://github.com/limosek/zaf-plugins.git'
ZAF_REPO_DIR='/usr/lib/zaf/repo'
ZAF_AGENT_CONFIGD='/etc/zabbix/zabbix_agentd.d'
ZAF_AGENT_BIN='/usr/sbin/zabbix_agentd'
ZAF_AGENT_RESTART='service zabbix-agent restart'