Ein recht einfaches Nagios Plugin für glb den Loadbalancer für Galera. Getestet mit glb-0.9.0beta2. Das ganze ist schnell zusammengeschrieben, also nicht über Fehler wundern. Zum download gibt es das hier:
http://exdc.net/nagios/check_glbd_connections
Ausgabe:
$ /usr/lib/nagios/plugins/check_glbd_connections 100 450 Warning current connections:257 | 'connections'=257 'maxconnections'=493 $ /usr/lib/nagios/plugins/check_glbd_connections 100 250 Critical current connections:257 | 'connections'=257 'maxconnections'=493 $ /usr/lib/nagios/plugins/check_glbd_connections 100 250 OK current connections:1 | 'connections'=1 'maxconnections'=493
Das Skript:
#!/bin/bash
#########################################################################
# Script: check_glbd_connections #
# Author: Thomas Linnemann (mail@exdc.net) http://exdc.net #
# Purpose: Monitor GLBS Connections status with Nagios #
# Thanks to: Bjoern Herbold, Alexey Yurchenko #
# History: 2012.12.18 version 0.0.1 #
# #
#########################################################################
print_usage() {
echo "Usage: check__glbd_connections warning critical "
echo "e.g. check_glbd_connections 350 450"
}
if [ $# -lt 2 ]; then
print_usage
exit 3
fi
conn_info=$(echo "getinfo" | nc -q 1 127.0.0.1 4041|grep Destinations)
conn=$(echo "$conn_info" | cut -d " " -f 5)
maxcon=$(echo "$conn_info" | cut -d " " -f 7)
if [[ $conn -ge $1 && $conn -lt $2 ]]
then
echo "Warning current connections:$conn | 'connections'=$conn 'maxconnections'=$maxcon"
exit 1
elif [ $conn -ge $2 ]
then
echo "Critical current connections:$conn | 'connections'=$conn 'maxconnections'=$maxcon"
exit 2
else
echo "OK current connections:$conn | 'connections'=$conn 'maxconnections'=$maxcon"
exit 0
fi
Performancedaten für Centreon werden auch geliefert (ja gelb ist eine tolle Farbe ich weiß)
