diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_pgsql.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index c26cd439..05fdc156 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 | ||