[Nagiosplug-checkins] nagiosplug/plugins check_mysql.c,1.24,1.25
Matthew Kent
mattkent at users.sourceforge.net
Thu Mar 17 19:16:10 CET 2005
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2236
Modified Files:
check_mysql.c
Log Message:
Replication check support for 4.1.x from Gerrit Beine
Index: check_mysql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_mysql.c 25 Dec 2004 23:17:44 -0000 1.24
+++ check_mysql.c 18 Mar 2005 03:14:03 -0000 1.25
@@ -123,8 +123,16 @@
die (STATE_CRITICAL, "%s\n", slaveresult);
}
+ } else if (mysql_field_count (&mysql) == 33) {
+ /* mysql >= 4.1.1 */
+ snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[10], row[11]);
+ if (strcmp (row[10], "Yes") != 0 || strcmp (row[11], "Yes") != 0) {
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "%s\n", slaveresult);
+ }
} else {
- /* mysql 4.x.x */
+ /* mysql 4.0.x or 4.1.0 */
snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]);
if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) {
mysql_free_result (res);
More information about the Commits
mailing list