Diagnostic changes

Added support for detecting beesip os
1.2
Lukas Macura 2016-04-19 11:09:22 +02:00
parent ddbdff55d9
commit 79b98bf661
3 changed files with 11 additions and 6 deletions

View File

@ -1,12 +1,15 @@
# Os related functions
zaf_configure_os_openwrt() {
ZAF_AGENT_RESTART="/etc/init.d/zabbix_agentd restart"
ZAF_AGENT_RESTART="zaf agent-config; /etc/init.d/zabbix_agentd restart"
ZAF_AGENT_CONFIGD="/var/run/zabbix_agentd.conf.d/"
ZAF_AGENT_CONFIG="/etc/zabbix_agentd.conf"
ZAF_AGENT_PKG="zabbix-agentd"
ZAF_CURL_INSECURE=1
}
zaf_configure_os_beesip() {
zaf_configure_os_openwrt
}
zaf_configure_os_freebsd() {
ZAF_AGENT_PKG="zabbix3-agent"

View File

@ -11,17 +11,17 @@ zaf_msg() {
echo $@
}
zaf_trc() {
[ "$ZAF_DEBUG" -ge "3" ] && logger -s -t zaf -- $@
[ "$ZAF_DEBUG" -ge "3" ] && logger -p user.info -s -t zaf-trace -- $@
}
zaf_dbg() {
[ "$ZAF_DEBUG" -ge "2" ] && logger -s -t zaf -- $@
[ "$ZAF_DEBUG" -ge "2" ] && logger -p user.debug -s -t zaf-debug -- $@
}
zaf_wrn() {
[ "$ZAF_DEBUG" -ge "1" ] && logger -s -t zaf -- $@
[ "$ZAF_DEBUG" -ge "1" ] && logger -p user.warn -s -t zaf-warning -- $@
}
zaf_err() {
logger -s -t zaf -- $@
logger -s -t zaf "Exiting with error!"
logger -s -p user.err -t zaf-error -- $@
logger -s -p user.err -t zaf-error "Exiting with error!"
exit 1
}
# Help option

2
zaf
View File

@ -83,9 +83,11 @@ userparms)
;;
agent-config)
zaf_wrn "Generating config files in $ZAF_AGENT_CONFIGD ..."
for plugin in $(zaf_list_plugins); do
plugindir=$ZAF_PLUGINS_DIR/$plugin
control=$plugindir/control.zaf
zaf_dbg "Generating ${ZAF_AGENT_CONFIGD}/zaf_${plugin}.conf"
zaf_ctrl_generate_cfg "${control}" "${plugin}" \
| zaf_far '{PLUGINDIR}' "${plugindir}" >${ZAF_AGENT_CONFIGD}/zaf_${plugin}.conf
done