diff options
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r-- | plugins/check_mysql.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 1e7a82f..735eaa2 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -98,25 +98,25 @@ main (int argc, char **argv) | |||
98 | /* check the slave status */ | 98 | /* check the slave status */ |
99 | if (mysql_query (&mysql, "show slave status") != 0) { | 99 | if (mysql_query (&mysql, "show slave status") != 0) { |
100 | mysql_close (&mysql); | 100 | mysql_close (&mysql); |
101 | die (STATE_CRITICAL, "slave query error: %s\n", mysql_error (&mysql)); | 101 | die (STATE_CRITICAL, _("slave query error: %s\n"), mysql_error (&mysql)); |
102 | } | 102 | } |
103 | 103 | ||
104 | /* store the result */ | 104 | /* store the result */ |
105 | if ( (res = mysql_store_result (&mysql)) == NULL) { | 105 | if ( (res = mysql_store_result (&mysql)) == NULL) { |
106 | mysql_close (&mysql); | 106 | mysql_close (&mysql); |
107 | die (STATE_CRITICAL, "slave store_result error: %s\n", mysql_error (&mysql)); | 107 | die (STATE_CRITICAL, _("slave store_result error: %s\n"), mysql_error (&mysql)); |
108 | } | 108 | } |
109 | 109 | ||
110 | /* fetch the first row */ | 110 | /* fetch the first row */ |
111 | if ( (row = mysql_fetch_row (res)) == NULL) { | 111 | if ( (row = mysql_fetch_row (res)) == NULL) { |
112 | mysql_free_result (res); | 112 | mysql_free_result (res); |
113 | mysql_close (&mysql); | 113 | mysql_close (&mysql); |
114 | die (STATE_CRITICAL, "slave fetch row error: %s\n", mysql_error (&mysql)); | 114 | die (STATE_CRITICAL, _("slave fetch row error: %s\n"), mysql_error (&mysql)); |
115 | } | 115 | } |
116 | 116 | ||
117 | if (mysql_field_count (&mysql) == 12) { | 117 | if (mysql_field_count (&mysql) == 12) { |
118 | /* mysql 3.23.x */ | 118 | /* mysql 3.23.x */ |
119 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave running: %s", row[6]); | 119 | snprintf (slaveresult, SLAVERESULTSIZE, _("Slave running: %s"), row[6]); |
120 | if (strcmp (row[6], "Yes") != 0) { | 120 | if (strcmp (row[6], "Yes") != 0) { |
121 | mysql_free_result (res); | 121 | mysql_free_result (res); |
122 | mysql_close (&mysql); | 122 | mysql_close (&mysql); |
@@ -151,7 +151,6 @@ main (int argc, char **argv) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | 153 | ||
154 | |||
155 | /* process command-line arguments */ | 154 | /* process command-line arguments */ |
156 | int | 155 | int |
157 | process_arguments (int argc, char **argv) | 156 | process_arguments (int argc, char **argv) |
@@ -212,9 +211,7 @@ process_arguments (int argc, char **argv) | |||
212 | print_help (); | 211 | print_help (); |
213 | exit (STATE_OK); | 212 | exit (STATE_OK); |
214 | case '?': /* help */ | 213 | case '?': /* help */ |
215 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); | 214 | usage2 (_("Unknown argument"), optarg); |
216 | print_usage (); | ||
217 | exit (STATE_UNKNOWN); | ||
218 | } | 215 | } |
219 | } | 216 | } |
220 | 217 | ||
@@ -245,7 +242,6 @@ process_arguments (int argc, char **argv) | |||
245 | } | 242 | } |
246 | 243 | ||
247 | 244 | ||
248 | |||
249 | int | 245 | int |
250 | validate_arguments (void) | 246 | validate_arguments (void) |
251 | { | 247 | { |
@@ -265,7 +261,6 @@ validate_arguments (void) | |||
265 | } | 261 | } |
266 | 262 | ||
267 | 263 | ||
268 | |||
269 | void | 264 | void |
270 | print_help (void) | 265 | print_help (void) |
271 | { | 266 | { |
@@ -304,7 +299,6 @@ a server listening on MySQL standard port %d will be checked\n"), MYSQL_PORT); | |||
304 | } | 299 | } |
305 | 300 | ||
306 | 301 | ||
307 | |||
308 | void | 302 | void |
309 | print_usage (void) | 303 | print_usage (void) |
310 | { | 304 | { |