Change attribute separator in HAproxy monitoring

Rework HAproxy monitoring so the item's parameters gets properly separated
using commas, allowing to use dots in parameter name.

Closes-bug: 1525713

Change-Id: I912ec25c34e52b0917715b271e198c4fd9f331fe
This commit is contained in:
Marcin Iwinski
2015-12-13 22:54:50 +01:00
parent ac3edcec5b
commit 3c40e9444a
3 changed files with 168 additions and 171 deletions

View File

@@ -34,12 +34,9 @@ case $1 in
;;
"-v")
OPER='value'
IFS=$'.'
QA=($2)
unset IFS
HAPX=${QA[0]}
HASV=${QA[1]}
ITEM=${QA[2]}
HAPX=$2
HASV=$3
ITEM=$4
FESQ="grep ^${HAPX},${HASV},"
;;
*)

View File

@@ -29,19 +29,19 @@ class plugin_zabbix::monitoring::haproxy_mon {
command => '/etc/zabbix/scripts/haproxy.sh -b';
'haproxy.be':
key => 'haproxy.be[*]',
command => '/etc/zabbix/scripts/haproxy.sh -v $1';
command => '/etc/zabbix/scripts/haproxy.sh -v $1 $2 $3';
'haproxy.fe.discovery':
key => 'haproxy.fe.discovery',
command => '/etc/zabbix/scripts/haproxy.sh -f';
'haproxy.fe':
key => 'haproxy.fe[*]',
command => '/etc/zabbix/scripts/haproxy.sh -v $1';
command => '/etc/zabbix/scripts/haproxy.sh -v $1 $2 $3';
'haproxy.sv.discovery':
key => 'haproxy.sv.discovery',
command => '/etc/zabbix/scripts/haproxy.sh -s';
'haproxy.sv':
key => 'haproxy.sv[*]',
command => '/etc/zabbix/scripts/haproxy.sh -v $1';
command => '/etc/zabbix/scripts/haproxy.sh -v $1 $2 $3';
}
}
}