mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 22:25:23 +00:00
Initial version
This commit is contained in:
parent
8b63e3cd96
commit
32bfecf5a1
1 changed files with 46 additions and 0 deletions
46
plugins/other/haproxy-response-errors
Executable file
46
plugins/other/haproxy-response-errors
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Pasha "p01nt" Klets <pasha@klets.name>
|
||||||
|
|
||||||
|
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 "$15}'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
graph_title="${title} response errors"
|
||||||
|
graph_vlabel=${title}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
config)
|
||||||
|
cat <<EOF
|
||||||
|
graph_category haproxy
|
||||||
|
graph_title ${graph_title}
|
||||||
|
graph_vlabel ${graph_vlabel}
|
||||||
|
|
||||||
|
`labels`
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
values
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue