Code

Removing CVS/SVN tags and replacing with git-based versioning
[nagiosplug.git] / plugins / check_mysql.c
index a9f0f600bc9964d2d81ceba735c6f0a4c09a12f7..a1a63769f2386c46a0fc7a232466a75a17e09e71 100644 (file)
@@ -7,8 +7,6 @@
 * Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
 * Copyright (c) 1999-2007 Nagios Plugins Development Team
 * 
-* Last Modified: $Date$
-*
 * Description:
 * 
 * This file contains the check_mysql plugin
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
-* $Id$
 * 
 *****************************************************************************/
 
 const char *progname = "check_mysql";
-const char *revision = "$Revision$";
 const char *copyright = "1999-2007";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
@@ -71,9 +67,9 @@ main (int argc, char **argv)
        MYSQL mysql;
        MYSQL_RES *res;
        MYSQL_ROW row;
-       
+
        /* should be status */
-       
+
        char *result = NULL;
        char *error = NULL;
        char slaveresult[SLAVERESULTSIZE];
@@ -186,7 +182,7 @@ main (int argc, char **argv)
                                mysql_close (&mysql);
                                die (STATE_CRITICAL, "Slave status unavailable\n");
                        }
-                       
+
                        snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], row[seconds_behind_field]);
                        if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) {
                                mysql_free_result (res);
@@ -310,7 +306,7 @@ process_arguments (int argc, char **argv)
                        critical = optarg;
                        break;
                case 'V':                                                                       /* version */
-                       print_revision (progname, revision);
+                       print_revision (progname, NP_VERSION);
                        exit (STATE_OK);
                case 'h':                                                                       /* help */
                        print_help ();
@@ -362,7 +358,7 @@ validate_arguments (void)
                db_host = strdup("");
 
        if (db_pass == NULL)
-               db_pass == strdup("");
+               db_pass = strdup("");
 
        if (db == NULL)
                db = strdup("");
@@ -377,7 +373,7 @@ print_help (void)
        char *myport;
        asprintf (&myport, "%d", MYSQL_PORT);
 
-       print_revision (progname, revision);
+       print_revision (progname, NP_VERSION);
 
        printf (_(COPYRIGHT), copyright, email);