summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLorenz <12514511+RincewindsHat@users.noreply.github.com>2023-05-21 22:57:31 (GMT)
committerGitHub <noreply@github.com>2023-05-21 22:57:31 (GMT)
commit1bce93b28a889edcaed10a920c931a6232940ad8 (patch)
tree370a6155fb7390c27bc4fee2926eb9a95a132657 /plugins
parentbc47263115a3d6c01ec3ad8ec95951581551a9f5 (diff)
parent4ed55a1d40ac8693c7d5c9aa3a7301f0a2236135 (diff)
downloadmonitoring-plugins-1bce93b28a889edcaed10a920c931a6232940ad8.tar.gz
Merge branch 'master' into check_swap_scanf_expressions
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_curl.c5
-rw-r--r--plugins/check_http.c1
-rw-r--r--plugins/check_mysql.c2
-rw-r--r--plugins/check_nt.c2
-rw-r--r--plugins/check_pgsql.c12
-rw-r--r--plugins/runcmd.c2
6 files changed, 17 insertions, 7 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index be5740d..100a97a 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -2217,11 +2217,10 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line)
2217 if( strchr( p, '.' ) != NULL ) { 2217 if( strchr( p, '.' ) != NULL ) {
2218 2218
2219 /* HTTP 1.x case */ 2219 /* HTTP 1.x case */
2220 char *ppp; 2220 strtok( p, "." );
2221 ppp = strtok( p, "." );
2222 status_line->http_major = (int)strtol( p, &pp, 10 ); 2221 status_line->http_major = (int)strtol( p, &pp, 10 );
2223 if( *pp != '\0' ) { free( first_line_buf ); return -1; } 2222 if( *pp != '\0' ) { free( first_line_buf ); return -1; }
2224 ppp = strtok( NULL, " " ); 2223 strtok( NULL, " " );
2225 status_line->http_minor = (int)strtol( p, &pp, 10 ); 2224 status_line->http_minor = (int)strtol( p, &pp, 10 );
2226 if( *pp != '\0' ) { free( first_line_buf ); return -1; } 2225 if( *pp != '\0' ) { free( first_line_buf ); return -1; }
2227 p += 4; /* 1.x SP */ 2226 p += 4; /* 1.x SP */
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 8c03bc8..6956a72 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1391,7 +1391,6 @@ char *unchunk_content(const char *content) {
1391 // https://en.wikipedia.org/wiki/Chunked_transfer_encoding 1391 // https://en.wikipedia.org/wiki/Chunked_transfer_encoding
1392 // https://www.rfc-editor.org/rfc/rfc7230#section-4.1 1392 // https://www.rfc-editor.org/rfc/rfc7230#section-4.1
1393 char *result = NULL; 1393 char *result = NULL;
1394 size_t content_length = strlen(content);
1395 char *start_of_chunk; 1394 char *start_of_chunk;
1396 char* end_of_chunk; 1395 char* end_of_chunk;
1397 long size_of_chunk; 1396 long size_of_chunk;
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 0cba50e..6cfa70e 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -551,7 +551,7 @@ print_help (void)
551 printf (" %s\n", _("Exit with CRITICAL status if slave server is more then INTEGER seconds")); 551 printf (" %s\n", _("Exit with CRITICAL status if slave server is more then INTEGER seconds"));
552 printf (" %s\n", _("behind master")); 552 printf (" %s\n", _("behind master"));
553 printf (" %s\n", "-l, --ssl"); 553 printf (" %s\n", "-l, --ssl");
554 printf (" %s\n", _("Use ssl encryptation")); 554 printf (" %s\n", _("Use ssl encryption"));
555 printf (" %s\n", "-C, --ca-cert=STRING"); 555 printf (" %s\n", "-C, --ca-cert=STRING");
556 printf (" %s\n", _("Path to CA signing the cert")); 556 printf (" %s\n", _("Path to CA signing the cert"));
557 printf (" %s\n", "-a, --cert=STRING"); 557 printf (" %s\n", "-a, --cert=STRING");
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 59c135d..d73d83c 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -341,7 +341,7 @@ int main(int argc, char **argv){
341 341
342 2) If the counter you're going to measure is percent-based, the code will detect 342 2) If the counter you're going to measure is percent-based, the code will detect
343 the percent sign in its name and will attribute minimum (0%) and maximum (100%) 343 the percent sign in its name and will attribute minimum (0%) and maximum (100%)
344 values automagically, as well the ¨%" sign to graph units. 344 values automagically, as well the "%" sign to graph units.
345 345
346 3) OTOH, if the counter is "absolute", you'll have to provide the following 346 3) OTOH, if the counter is "absolute", you'll have to provide the following
347 the counter unit - that is, the dimensions of the counter you're getting. Examples: 347 the counter unit - that is, the dimensions of the counter you're getting. Examples:
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
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index 1bd2ca1..c1d675d 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -44,6 +44,8 @@
44# include <sys/wait.h> 44# include <sys/wait.h>
45#endif 45#endif
46 46
47#include "./utils.h"
48
47/** macros **/ 49/** macros **/
48#ifndef WEXITSTATUS 50#ifndef WEXITSTATUS
49# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) 51# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)