[Nagiosplug-devel] [patch] mysql_check.c & REQUIREMENTS

Daniël van Eeden nagios at myname.nl
Mon Jul 4 11:36:39 CEST 2011


 Hi,

 There was no progress on this bug/patch in a few months. On sf.net it's 
 still Open.

 Does this mean that check_mysql is not longer maintained?

 Regards,

 Daniël

 On Mon, 11 Apr 2011 15:13:09 +0200, Daniël van Eeden wrote:
> Hi,
>
>  I've created a patch to fix the documentation in the REQUIREMENTS 
> file
>  and to add some more comments to check_mysql.c
>
>  SF.net BugID:
>
> 
> http://sourceforge.net/tracker/?func=detail&aid=3269273&group_id=29880&atid=397597
>
>  Regards,
>
>  Daniël van Eeden
>
>  diff --git a/REQUIREMENTS b/REQUIREMENTS
>  index fd41ded..33c5eb9 100644
>  --- a/REQUIREMENTS
>  +++ b/REQUIREMENTS
>  @@ -36,10 +36,9 @@ check_ldap:
>
>   check_mysql, check_mysql_query:
>   	- Requires the MySQL libraries available from
>  -	  http://www.mysql.org/
>  +	  http://dev.mysql.com/downloads/
>   		Lib: libmysql, libmysqlclient
>  -		Redhat Powertools Source: mysql-3.20.32a-3.i386.rpm,
>  mysql-devel-3.20.32a-3.i386.rpm (these seem to be broken, however)
>  -		RPMS from www.mysql.org work better
>  +		Redhat Source (RHEL6, YUM): mysql-devel, mysql-libs
>   	  Must have mysql_config in PATH or specified with 
> --with-mysql=DIR
>  for DIR/bin/mysql_config
>
>   check_pqsql:
>  diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
>  index d9b4e53..0dfb1fd 100644
>  --- a/plugins/check_mysql.c
>  +++ b/plugins/check_mysql.c
>  @@ -5,7 +5,7 @@
>   * License: GPL
>   * Copyright (c) 1999 Didi Rieder (adrieder at sbox.tu-graz.ac.at)
>   * Copyright (c) 2000 Karl DeBisschop
>  (kdebisschop at users.sourceforge.net)
>  -* Copyright (c) 1999-2009 Nagios Plugins Development Team
>  +* Copyright (c) 1999-2011 Nagios Plugins Development Team
>   *
>   * Description:
>   *
>  @@ -31,7 +31,7 @@
>
>
> 
> *****************************************************************************/
>
>   const char *progname = "check_mysql";
>  -const char *copyright = "1999-2007";
>  +const char *copyright = "1999-2011";
>   const char *email = "nagiosplug-devel at lists.sourceforge.net";
>
>   #define SLAVERESULTSIZE 70
>  @@ -157,7 +157,7 @@ main (int argc, char **argv)
>   			}
>
>   		} else {
>  -			/* mysql 4.x.x */
>  +			/* mysql 4.x.x and mysql 5.x.x */
>   			int slave_io_field = -1 , slave_sql_field = -1,
>  seconds_behind_field = -1, i, num_fields;
>   			MYSQL_FIELD* fields;
>
>  @@ -178,13 +178,17 @@ main (int argc, char **argv)
>   				}
>   			}
>
>  +			/* Check if slave status is available */
>   			if ((slave_io_field < 0) || (slave_sql_field < 0) || (num_fields 
> ==
>  0)) {
>   				mysql_free_result (res);
>   				mysql_close (&mysql);
>   				die (STATE_CRITICAL, "Slave status unavailable\n");
>   			}
>
>  +			/* Save slave status in slaveresult */
>   			snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: 
> %s
>  Seconds Behind Master: %s", row[slave_io_field], 
> row[slave_sql_field],
>  seconds_behind_field!=-1?row[seconds_behind_field]:"Unknown");
>  +
>  +			/* Raise critical error if SQL THREAD or IO THREAD are stopped 
> */
>   			if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp
>  (row[slave_sql_field], "Yes") != 0) {
>   				mysql_free_result (res);
>   				mysql_close (&mysql);
>  @@ -199,6 +203,7 @@ main (int argc, char **argv)
>   				}
>   			}
>
>  +			/* Check Seconds Behind against threshold */
>   			if ((seconds_behind_field != -1) && (strcmp
>  (row[seconds_behind_field], "NULL") != 0)) {
>   				double value = atof(row[seconds_behind_field]);
>   				int status;
>
> 
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________________
> Nagios Plugin Development Mailing List 
> Nagiosplug-devel at lists.sourceforge.net
> Unsubscribe at 
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> ::: Please include plugins version (-v) and OS when reporting any 
> issue.
> ::: Messages without supporting info will risk being sent to 
> /dev/null




More information about the Devel mailing list