Um dos meus scripts de monitoramento HAProxy não está funcionando em uma nova caixa HAProxy de configuração. Eu rastreei o problema na saída do soquete de estatísticas, e não no próprio script.
Estou recebendo valores de "0" relatados por meio do soquete, mas os valores corretos da interface da Web.
Alguém pode explicar as diferenças na saída?
Da saída de echo 'show stat' | nc -U /var/run/haproxy.socket
:
pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt,
haproxystats,FRONTEND,,,0,0,4096,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,1,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,,
haproxystats,BACKEND,0,0,0,0,4096,0,0,0,0,0,,0,0,0,0,UP,0,0,0,,0,155,0,,1,1,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0,
vip1,FRONTEND,,,0,0,4096,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,,
webservers,web1,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,1,,0,,2,0,,0,L7OK,200,0,0,0,0,0,0,0,0,,,,0,0,
webservers,web2,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,2,,0,,2,0,,0,L7OK,200,0,0,0,0,0,0,0,0,,,,0,0,
webservers,web3,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,3,,0,,2,0,,0,L7OK,200,0,0,0,0,0,0,0,0,,,,0,0,
webservers,web4,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,4,,0,,2,0,,0,L7OK,200,1,0,0,0,0,0,0,0,,,,0,0,
webservers,web5,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,5,,0,,2,0,,0,L7OK,200,0,0,0,0,0,0,0,0,,,,0,0,
webservers,web6,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,155,0,,1,3,6,,0,,2,0,,0,L7OK,200,0,0,0,0,0,0,0,0,,,,0,0,
webservers,BACKEND,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,UP,6,6,0,,0,155,0,,1,3,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0,
Saída CSV da interface web do mesmo servidor:
pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt,
haproxystats,FRONTEND,,,1,2,4096,309,186616,3323540,0,0,0,,,,,OPEN,,,,,,,,,1,1,0,,,,0,1,0,4,,,,0,225,0,0,83,0,,1,4,309,,,
haproxystats,BACKEND,0,0,0,1,4096,83,186616,3323540,0,0,,83,0,0,0,UP,0,0,0,,0,231,0,,1,1,0,,0,,1,1,,2,,,,0,0,0,0,83,0,,,,,0,0,
vip1,FRONTEND,,,6,11,4096,20,45181,1069426,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,7,,,,0,69,3,4,0,0,,0,30,76,,,
webservers,web1,0,0,0,2,,13,7445,243262,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,1,,13,,2,0,,5,L7OK,200,1,0,12,1,0,0,0,0,,,,0,0,
webservers,web2,0,0,0,1,,13,7445,127627,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,2,,13,,2,0,,5,L7OK,200,0,0,12,0,1,0,0,0,,,,0,0,
webservers,web3,0,0,0,1,,13,7570,81039,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,3,,13,,2,0,,5,L7OK,200,0,0,13,0,0,0,0,0,,,,0,0,
webservers,web4,0,0,0,1,,13,8053,182209,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,4,,13,,2,0,,5,L7OK,200,1,0,11,1,1,0,0,0,,,,0,0,
webservers,web5,0,0,0,2,,12,7288,230933,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,5,,12,,2,0,,5,L7OK,200,1,0,11,0,1,0,0,0,,,,0,0,
webservers,web6,0,0,0,1,,12,7380,204356,,0,,0,0,0,0,UP,1,1,0,0,0,231,0,,1,3,6,,12,,2,0,,5,L7OK,200,1,0,10,1,1,0,0,0,,,,0,0,
webservers,BACKEND,0,0,0,6,0,76,45181,1069426,0,0,,0,0,0,0,UP,6,6,0,,0,231,0,,1,3,0,,76,,1,0,,30,,,,0,69,3,4,0,0,,,,,0,0,
Informação da versão:
[root@haproxy ~]# haproxy -v
HA-Proxy version 1.4.19 2012/01/07
Execução de configuração relevante:
global
log 127.0.0.1 local0 debug
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/run/haproxy.socket
Permissões:
[root@haproxy ~]# ls -lah /var/run/haproxy.socket
srwxr-xr-x 1 root root 0 Mar 9 14:13 /var/run/haproxy.socket
Tags haproxy