# where do I get check\_mysql?

**URL:** <https://forums.percona.com/t/where-do-i-get-check-mysql/1529>\
**Category:** Other MySQL® Questions\
**Created:** [October 9, 2010, 3:06pm UTC](https://forums.percona.com/t/where-do-i-get-check-mysql/1529 "2010-10-09T15:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iberkner](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iberkner](https://forums.percona.com/u/iberkner)\
**Post date:** [October 9, 2010, 3:06pm UTC](https://forums.percona.com/t/where-do-i-get-check-mysql/1529/1 "2010-10-09T15:06:35Z")

</div>

As part of checking replication on a slave, our consultants are using a check\_mysql file. I’m setting up a slave for backup purposes and wanted to run the same checks against the new slave. I copied the check\_mysql file from our current slave to the new slave but it doesn’t run, I get this error:

-bash: ./check\_mysql: cannot execute binary file

The file probably needs to be compiled from source? or maybe something else?

Where do I get this file? I thought it was part of maatkit but its not?

Thanks

---

<div class="post-metadata">

**Author:** ![iberkner](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iberkner](https://forums.percona.com/u/iberkner)\
**Post date:** [October 9, 2010, 3:21pm UTC](https://forums.percona.com/t/where-do-i-get-check-mysql/1529/2 "2010-10-09T15:21:27Z")

</div>

I think I figured this out to be the nagios check\_mysql plugin. I installed the plugins and copied the file and it seems to be working correctly.

---

<div class="post-metadata">

**Author:** ![ri0day](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@ri0day](https://forums.percona.com/u/ri0day)\
**Post date:** [October 20, 2010, 10:49am UTC](https://forums.percona.com/t/where-do-i-get-check-mysql/1529/3 "2010-10-20T10:49:06Z")

</div>

this my simple script for nagios monitor plugin,you can modfiy to suit you environment

#!/bin/baship=$(/sbin/ifconfig eth1 |sed -n 2p |sed ‘s/^._addr://g’|sed 's/Bcast._//g’)mysql -uuser -ppasswd -hhost -e"show slave status \G" \>/tmp/$$.statusstatus=$(grep Seconds\_Behind\_Master: /tmp/$$.status)s1=${status##\*:}if [[$s1 == “NULL”]];then echo “CRITICAL - REPLICATION IS STOP - $ip” exit 2fiif [[$s1 -lt 200]]then echo “OK - $s1 s - $ip " exit 0else echo “WARINING - Slave Behind Master $s1 S - $ip” exit 1firm -rf /tmp/$$.status”
