summaryrefslogtreecommitdiffstats
path: root/plugins/check_pgsql.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2023-09-20 06:16:11 (GMT)
committerGitHub <noreply@github.com>2023-09-20 06:16:11 (GMT)
commita5ba424f85153b1ddaaf5e5269c82f0f049828d0 (patch)
treeb9c158930159f2ab1ea2eb45e9e19ccdd0fbb76b /plugins/check_pgsql.c
parenta99db0243baa5d208c5d500a9bde86b4619cec92 (diff)
parent220455a11e8f1dd3a86ac4725cf0c799c8e3b21b (diff)
downloadmonitoring-plugins-a5ba424f85153b1ddaaf5e5269c82f0f049828d0.tar.gz
Merge branch 'master' into masterrefs/pull/1637/head
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r--plugins/check_pgsql.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index c26cd43..6199033 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -93,7 +93,7 @@ int verbose = 0;
93 93
94/****************************************************************************** 94/******************************************************************************
95 95
96The (psuedo?)literate programming XML is contained within \@\@\- <XML> \-\@\@ 96The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
97tags in the comments. With in the tags, the XML is assembled sequentially. 97tags in the comments. With in the tags, the XML is assembled sequentially.
98You can define entities in tags. You also have all the #defines available as 98You can define entities in tags. You also have all the #defines available as
99entities. 99entities.
@@ -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