diff --git a/install.sh b/install.sh index 6e8473b..7978eb5 100755 --- a/install.sh +++ b/install.sh @@ -179,7 +179,7 @@ zaf_configure_agent() { else zaf_unset_agent_option "$option" fi - options="$options Z_$option='$value'" + options="$options Z_$option=$value" done zaf_set_option ZAF_AGENT_OPTIONS "${options}" } diff --git a/lib/zaf.lib.sh b/lib/zaf.lib.sh index 843e4cc..61fbe36 100644 --- a/lib/zaf.lib.sh +++ b/lib/zaf.lib.sh @@ -267,13 +267,17 @@ zaf_install_plugin() { local plugin local plugindir local control + local version if zaf_prepare_plugin "$1" "${ZAF_TMP_DIR}/plugin"; then url=$(zaf_get_plugin_url "$1") - plugin=$(zaf_ctrl_get_global_block <"${ZAF_TMP_DIR}/plugin/control.zaf" | zaf_block_get_option Plugin) + control="${ZAF_TMP_DIR}/plugin/control.zaf" + plugin=$(zaf_ctrl_get_global_option $control Plugin) + version=$(zaf_ctrl_get_global_option $control Version) plugindir="${ZAF_PLUGINS_DIR}"/$plugin if [ -n "$plugin" ] && zaf_prepare_plugin "$1" $plugindir; then - zaf_wrn "Installing plugin $plugin from $url to $plugindir" + zaf_wrn "Installing plugin $plugin version $version" + zaf_dbg "Source url: $url, Destination dir: $plugindir" control=${plugindir}/control.zaf [ "$ZAF_DEBUG" -gt 1 ] && zaf_plugin_info "${control}" zaf_ctrl_check_deps "${control}" @@ -413,7 +417,7 @@ zaf_precache_item() { zaf_remove_plugin() { ! zaf_is_plugin $1 && { zaf_err "Plugin $1 not installed!"; } - zaf_wrn "Removing plugin $1" + zaf_wrn "Removing plugin $1 (version $(zaf_plugin_version $1))" rm -rf ${ZAF_PLUGINS_DIR}/$1 rm -f ${ZAF_AGENT_CONFIGD}/zaf_$1.conf ${ZAF_CROND}/zaf_$1 ${ZAF_SUDOERSD}/zaf_$1 } diff --git a/lib/zbxapi.lib.sh b/lib/zbxapi.lib.sh index 24a6b5e..5cfa897 100644 --- a/lib/zbxapi.lib.sh +++ b/lib/zbxapi.lib.sh @@ -44,7 +44,7 @@ zaf_zbxapi_login(){ local pass local result - [ -z "$ZAF_ZBXAPI_URL" ] || [ -z "$ZAF_ZBXAPI_USER" ] || [ -z "$ZAF_ZBXAPI_PASS" ] && zaf_err "Zabbix Api parameters not set!" + [ -z "$ZAF_ZBXAPI_URL" ] || [ -z "$ZAF_ZBXAPI_USER" ] || [ -z "$ZAF_ZBXAPI_PASS" ] && zaf_err "Zabbix Api parameters not set! Set ZAF_ZBXAPI_URL, ZAF_ZBXAPI_USER and ZAF_ZBXAPI_PASS and try again." authstr='{ "method" : "user.login", "params" : {