Skip to content

Commit

Permalink
* Fixed the space issue in a variable as we had before with c-client
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcobra1973 committed Aug 29, 2014
1 parent e2a1b4c commit a587ec4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions contrib/zabbix/externalscripts/vpoller-zabbix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@
OPTIND=1 # Reset in case getopts has been used previously in the shell.

# Initialize our own variables:
whitespace="[[:space:]]"
_vsphere=
#_args=$(echo $@ | sed 's@-k [A-Z]:@&\\\\@g')
_args="$@"
#_args="$@"
_args=''

### Process command line with spaces in
for i in "$@"
do
if [[ $i =~ $whitespace ]]
then
_args="${_args} \"$i\""
else
_args="${_args} $i"
fi
done

### Processing opts to retrieve vSphere host
while getopts "hvDm:n:p:r:t:e:V:k:U:P:o:H:" opt
Expand Down Expand Up @@ -51,5 +63,5 @@ then
fi

### Excute the vpoller-client
#sh -c "vpoller-client -H vpoller.helpers.zabbix ${_args}" | awk '{print $1;}'
vpoller-client -H vpoller.helpers.zabbix ${_args}
sh -c "vpoller-client -H vpoller.helpers.zabbix ${_args}" | awk '{print $1;}'
#vpoller-client -H vpoller.helpers.zabbix ${_args}

0 comments on commit a587ec4

Please sign in to comment.