summaryrefslogtreecommitdiffstats
path: root/plugins/check_pgsql.c
diff options
context:
space:
mode:
authorwaja <waja@users.noreply.github.com>2023-06-28 14:38:22 (GMT)
committerGitHub <noreply@github.com>2023-06-28 14:38:22 (GMT)
commit9ef6660cab8eb2b017323b9e000cb3560f07886b (patch)
treee88c70524d4289bbe175f3601e20704690f29f28 /plugins/check_pgsql.c
parentb4e578e2cd835221ee343e56923588828d36f99b (diff)
parentb24eb7f46ac8667324efd818c01d68d5a1376c89 (diff)
downloadmonitoring-plugins-9ef6660cab8eb2b017323b9e000cb3560f07886b.tar.gz
Merge branch 'master' into compiler_warning_part_6
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r--plugins/check_pgsql.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 94a03b2..6199033 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -517,7 +517,10 @@ print_help (void)
517 printf (" %s\n", _("connecting to the server. The result from the query has to be numeric.")); 517 printf (" %s\n", _("connecting to the server. The result from the query has to be numeric."));
518 printf (" %s\n", _("Multiple SQL commands, separated by semicolon, are allowed but the result ")); 518 printf (" %s\n", _("Multiple SQL commands, separated by semicolon, are allowed but the result "));
519 printf (" %s\n", _("of the last command is taken into account only. The value of the first")); 519 printf (" %s\n", _("of the last command is taken into account only. The value of the first"));
520 printf (" %s\n\n", _("column in the first row is used as the check result.")); 520 printf (" %s\n", _("column in the first row is used as the check result. If a second column is"));
521 printf (" %s\n", _("present in the result set, this is added to the plugin output with a"));
522 printf (" %s\n", _("prefix of \"Extra Info:\". This information can be displayed in the system"));
523 printf (" %s\n\n", _("executing the plugin."));
521 524
522 printf (" %s\n", _("See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual")); 525 printf (" %s\n", _("See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"));
523 printf (" %s\n\n", _("for details about how to access internal statistics of the database server.")); 526 printf (" %s\n\n", _("for details about how to access internal statistics of the database server."));
@@ -557,6 +560,7 @@ do_query (PGconn *conn, char *query)
557 PGresult *res; 560 PGresult *res;
558 561
559 char *val_str; 562 char *val_str;
563 char *extra_info;
560 double value; 564 double value;
561 565
562 char *endptr = NULL; 566 char *endptr = NULL;
@@ -621,6 +625,12 @@ do_query (PGconn *conn, char *query)
621 printf ("|query=%f;%s;%s;;\n", value, 625 printf ("|query=%f;%s;%s;;\n", value,
622 query_warning ? query_warning : "", 626 query_warning ? query_warning : "",
623 query_critical ? query_critical : ""); 627 query_critical ? query_critical : "");
628 if (PQnfields (res) > 1) {
629 extra_info = PQgetvalue (res, 0, 1);
630 if (extra_info != NULL) {
631 printf ("Extra Info: %s\n", extra_info);
632 }
633 }
624 return my_status; 634 return my_status;
625} 635}
626 636