Search This Blog

Monday, September 24, 2007

Small script to check MySQL replication

Small script to check MySQL replication on FreeBSD. Path to mysql.sock as a parameter:

cat /usr/local/opt/check_relication.sh
#!/bin/sh
treshold=1200

### Do not edit below
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

if [ -z $1 ] ; then
echo "Usage: $0 /path/to/mysql.sock"
exit 255
fi

seconds=`mysql -S $1 -N -e "show slave status\G" | grep Seconds_Behind_Master | cut -d: -f 2`

if [ -z $seconds ] ; then
exit 255
fi

if [ $seconds = "NULL" ]; then
echo Replication kaput!!!
exit 255
fi

if [ $seconds -gt $treshold ]; then
echo Slave behind the master more than $treshold seconds!
fi


Just put to crontab something like this:
*/30 * * * * /usr/local/opt/check_relication.sh /tmp/mysql.sock

7 comments:

xjd7410@gmail.com said...

20150922 junda
abercrombie
Hollister uk
Air Jordan 3 III Retro Free Shipping
louis vuitton
coach outlet
Cheap Jordans For Sale Wholesale
canada goose jackets
Christian Louis Vuitton Red Bottoms
New Louis Vuitton Handbags Outlet
Official Coach Factory Outlet Online Sale
Jordan 13 Shoes For Sale
canada goose outlet
Real Louis Vuitton Bags
nike trainers
Jordan 8 Bugs Bunny
Authentic Louis Vuitton Belts Outlet Store
burberry outlet
Louis Vuitton Bags On Sale
true religion jeans
canada goose outlet online
Lebron James Basketball Shoes Sale
Louis Vuitton Handbags Discount Off
nfl jerseys
Abercrombie T-Shirts
Discount Ray Ban Polarized Sunglasses
coach factory outlet online
Louis Vuitton Outlet USA
celine
Louis Vuitton Luxury Official Website
michael kors outlet

John said...

louis vuitton handbags
louis vuitton
abercrombie & fitch
cheap jordans
cheap uggs for sale
canada goose jackets
christian louboutin outlet
ralph lauren polo
canada goose outlet
michael kors handbags
celine bags
nike roshe run
ugg boots
gucci handbags
michael kors outlet online
coach outlet
ugg outlet
louis vuitton
ugg boots
hollister clothing
toms outlet
coach outlet online
hollister jeans
louis vuitton
louis vuitton outlet online
ugg boots
cheap uggs
coach outlet
louis vuitton outlet stores
oakley sunglasses
gucci shoes
20151125yuanyuan

chenlili said...

2016-4-21 xiaobao
longchamp handbags
christian louboutin outlet
cheap jordan shoes
louis vuitton handbags
coach outlet online
air jordan retro
polo ralph lauren
toms shoes
oakley outlet
adidas uk
michael kors outlet clearance
jordans
fitflop sandals
coach outlet
ray ban sunglasses
michael kors handbags
coach factorty outlet
nike outlet store
tory burch outlet
nike outlet store
ray ban
adidas originals
ugg boots
ray ban wayfarer
ray ban sunglasses
polo ralph lauren
oakley vault
coach factory outlet
christian louboutin outlet
louis vuitton handbags
michael kors outlet online
jordan 8s
michael kors outlet
coach factory outlet
adidas originals shoes
ray ban sunglasses
jordan 13
true religion outlet
air jordans
vans shoes

chenmeinv0 said...

coach outlet online
true religion outlet
tory burch shoes
ugg outlet
hollister jeans
moncler soldes
instyler curling iron
toms outlet
cheap rolex watches
ugg boots
20172.6chenjinyan

Unknown said...

kd shoes
tory burch outlet online
valentino outlet
yeezy shoes
birkenstock
coach factory outlet online
cheap jordan shoes
louis vuitton outlet online
louis vuitton handbags
ralph lauren sale
xushengda0528

Unknown said...



https://khalejmovers.com/نقل-اثاث-من-الرياض-الى-الدمام/
https://khalejmovers.com/نقل-عفش-من-الرياض-الى-المدينة-المنورة/
https://khalejmovers.com/نقل-عفش-من-الرياض-الى-ابها/
https://khalejmovers.com/نقل-اثاث-من-الرياض-الى-القصيم/
https://khalejmovers.com/نقل-اثاث-من-الرياض-الى-جازان-نجران/

NinalDavisq said...

The Cheap Real Yeezys's sole, as mentioned earlier, comes white - with portions of it showing of at the very front and back ends of the shoe. It is quite a thick sole, by the way. For a tying mechanism, the Cheap Yeezys employs both a shoe-thread/hole mechanism and a 'flap' mechanism.

Coach Outlet Online is one of the best fashion Coach Bags Outlet in the world. Michael Kors Bags Outlet is known for its best quality Michael Kors Purse Outlet that are usually used by actresses and also rich people. The price of Coach Outlet Store Online is also not cheap, means that it is really expensive. One of the best features of this thing is the sturdiness of the MK Outlet. Coach Bags Clearance have really high quality and they are made of high quality raw materials.