[Nagiosplug-devel] Patch for check_mysql

Matthew Kent mkent at magoazul.com
Fri Feb 25 11:43:39 CET 2005


Thanks, will append it to the other mysql ticket so I don't forget. 

- Matt

On Thu, 2005-24-02 at 21:14 +0100, Gerrit Beine wrote:
> Hi there,
> 
> this is a patch for making check_mysql working together
> with replication systems on MySQL 4.1.1 and higher.
> 
> So long...
> 
> Gerrit
> plain text document attachment (patch-check_mysql.c)
> --- plugins/check_mysql.c.orig	Sun Dec 26 00:17:44 2004
> +++ plugins/check_mysql.c	Sun Feb 20 14:12:10 2005
> @@ -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 Devel mailing list