Projet

Général

Profil

Révision 4f29ff59

ID4f29ff59b13c0fae4c46eb7d9ee8f03256661965
Parent a717a913
Enfant 73bf794a, 4771fd2b

Ajouté par rfrail3 il y a environ 13 ans

Add support for sockets

Voir les différences:

plugins/haproxy/haproxy_active_backend
13 13
  user root
14 14
  env.backend backend_name_1 backend_name_2 backend_name_3
15 15
  env.frontend frontend_name_1 frontend_name_2 frontend_name_3
16
  env.url  http://user:passwd@IP:port/admin?stats;csv
16
  # You can use url o socket option, use one of them, not both!
17
    env.url  http://user:passwd@IP:port/admin?stats;csv
18
  #  or
19
    env.socket /var/lib/haproxy/stats.socket
17 20

  
18 21
=head1 AUTHOR
19 22

  
......
39 42
	PXNAME="$1"
40 43
	SVNAME="$2"
41 44
	VALUE="$3"
42
	LINE1=`curl -s "$url" | head -1 | sed 's/# //'`
43
	LINE2=`curl -s "$url" | grep "$PXNAME,$SVNAME"`
44 45

  
46
	if [ ! -z "$url" ]; then
47
                LINE1=`curl -s "$url" | head -1 | sed 's/# //'`
48
                LINE2=`curl -s "$url" | grep "$PXNAME,$SVNAME"`
49
        fi
50

  
51
        if [ ! -z "$socket" ]; then
52
                LINE1=`echo 'show stat' | socat unix-connect:"$socket" stdio | head -1 | sed 's/# //'`
53
                LINE2=`echo 'show stat' | socat unix-connect:"$socket" stdio | grep "$PXNAME,$SVNAME"`
54
        fi
45 55
	ARRAY1=($LINE1);
46 56

  
47 57
	# Find values

Formats disponibles : Unified diff