Skip to content
Snippets Groups Projects
Commit 8bdb79b2 authored by Kristóf Bajnok's avatar Kristóf Bajnok
Browse files

Fix argument parsing and zabbix_sender invocation

parent 52fc05e4
Branches zabbix
No related merge requests found
......@@ -14,6 +14,7 @@
# Exaple: zabbixwrapper_check 's/^OK -- ([0-9.]+) .*/$1/;'
zabbixwrapper_parse_opts () {
local OPTIND
passThru=() # init. pass-through array
zabbix_opt=""
......@@ -22,17 +23,14 @@ zabbixwrapper_parse_opts () {
Z)
zabbix_server=$OPTARG
zabbix_opt+="-z $OPTARG "
shift "$((OPTIND-1))"
;;
K)
zabbix_key=$OPTARG
zabbix_opt+="-k $OPTARG "
shift "$((OPTIND-1))"
;;
N)
zabbix_name=$OPTARG
zabbix_opt+="-s $OPTARG "
shift "$((OPTIND-1))"
;;
*)
passThru+=( "-$OPTARG" )
......@@ -72,7 +70,7 @@ zabbixwrapper_evaluate () {
# This is also true if the check exits with a WARNING. You might want
# to set tresholds to avoid warning state from the plugin
echo "-1"
zabbix-sender $zabbix_opt -o $check_out
zabbix_sender $zabbix_opt -o "$check_out"
;;
esac
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment