diff --git a/plugins/other/haproxy-connection-errors b/plugins/other/haproxy-connection-errors new file mode 100755 index 00000000..aefb3397 --- /dev/null +++ b/plugins/other/haproxy-connection-errors @@ -0,0 +1,46 @@ +#!/bin/sh +# Pasha "p01nt" Klets + +name=`basename $0` +title=`echo ${name} | awk -F_ '{print $NF}'` + +hp_stat() { + echo "show stat" | socat unix-connect:/tmp/haproxy stdio +} + +servers_section() { + hp_stat | grep '^'${title}',' | egrep -v '^'${title}',(FRONTEND|BACKEND)' +} + +servers() { + servers_section | awk -F, '{print $2}' +} + +labels() { + servers_section | awk -F, '{print $2".label "$2"\n"$2".type COUNTER\n"$2".draw AREASTACK"}' +} + +values() { + servers_section | awk -F, '{print $2".value "$14}' +} + + +graph_title="${title} connection errors" +graph_vlabel=${title} + +case $1 in + config) + cat <