diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-10-06 09:53:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-06 09:53:02 +0200 |
| commit | ea8e421f4c49451fc2d93f4b4aaefd7c1cf88814 (patch) | |
| tree | 7b4f9f64a2064c60076f69bdb51389f7ddd05c8d /plugins | |
| parent | a516b5e96e1b4dff0867d4ae3329b39d918a5a59 (diff) | |
| parent | 392c945966d96d1dba9c68ac7a73450c2ad72d85 (diff) | |
| download | monitoring-plugins-ea8e421f4c49451fc2d93f4b4aaefd7c1cf88814.tar.gz | |
Merge pull request #2163 from RincewindsHat/check_mysql_more_renaming
More renaming due to MySQL name chances
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_mysql.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 062ec657..6134d6c6 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
| @@ -282,17 +282,32 @@ int main(int argc, char **argv) { | |||
| 282 | num_fields = mysql_num_fields(res); | 282 | num_fields = mysql_num_fields(res); |
| 283 | fields = mysql_fetch_fields(res); | 283 | fields = mysql_fetch_fields(res); |
| 284 | for (int i = 0; i < num_fields; i++) { | 284 | for (int i = 0; i < num_fields; i++) { |
| 285 | if (strcmp(fields[i].name, "Slave_IO_Running") == 0) { | 285 | if (use_deprecated_slave_status) { |
| 286 | replica_io_field = i; | 286 | if (strcmp(fields[i].name, "Slave_IO_Running") == 0) { |
| 287 | continue; | 287 | replica_io_field = i; |
| 288 | } | 288 | continue; |
| 289 | if (strcmp(fields[i].name, "Slave_SQL_Running") == 0) { | 289 | } |
| 290 | replica_sql_field = i; | 290 | if (strcmp(fields[i].name, "Slave_SQL_Running") == 0) { |
| 291 | continue; | 291 | replica_sql_field = i; |
| 292 | } | 292 | continue; |
| 293 | if (strcmp(fields[i].name, "Seconds_Behind_Master") == 0) { | 293 | } |
| 294 | seconds_behind_field = i; | 294 | if (strcmp(fields[i].name, "Seconds_Behind_Master") == 0) { |
| 295 | continue; | 295 | seconds_behind_field = i; |
| 296 | continue; | ||
| 297 | } | ||
| 298 | } else { | ||
| 299 | if (strcmp(fields[i].name, "Replica_IO_Running") == 0) { | ||
| 300 | replica_io_field = i; | ||
| 301 | continue; | ||
| 302 | } | ||
| 303 | if (strcmp(fields[i].name, "Replica_SQL_Running") == 0) { | ||
| 304 | replica_sql_field = i; | ||
| 305 | continue; | ||
| 306 | } | ||
| 307 | if (strcmp(fields[i].name, "Seconds_Behind_Source") == 0) { | ||
| 308 | seconds_behind_field = i; | ||
| 309 | continue; | ||
| 310 | } | ||
| 296 | } | 311 | } |
| 297 | } | 312 | } |
| 298 | 313 | ||
