diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-09-20 08:16:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-20 08:16:11 +0200 |
| commit | a5ba424f85153b1ddaaf5e5269c82f0f049828d0 (patch) | |
| tree | b9c158930159f2ab1ea2eb45e9e19ccdd0fbb76b /plugins/check_pgsql.c | |
| parent | a99db0243baa5d208c5d500a9bde86b4619cec92 (diff) | |
| parent | 220455a11e8f1dd3a86ac4725cf0c799c8e3b21b (diff) | |
| download | monitoring-plugins-a5ba424f85153b1ddaaf5e5269c82f0f049828d0.tar.gz | |
Merge branch 'master' into master
Diffstat (limited to 'plugins/check_pgsql.c')
| -rw-r--r-- | plugins/check_pgsql.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index c26cd439..61990335 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
| @@ -93,7 +93,7 @@ int verbose = 0; | |||
| 93 | 93 | ||
| 94 | /****************************************************************************** | 94 | /****************************************************************************** |
| 95 | 95 | ||
| 96 | The (psuedo?)literate programming XML is contained within \@\@\- <XML> \-\@\@ | 96 | The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@ |
| 97 | tags in the comments. With in the tags, the XML is assembled sequentially. | 97 | tags in the comments. With in the tags, the XML is assembled sequentially. |
| 98 | You can define entities in tags. You also have all the #defines available as | 98 | You can define entities in tags. You also have all the #defines available as |
| 99 | entities. | 99 | entities. |
| @@ -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 | ||
