summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--lib/utils_base.c8
-rw-r--r--plugins-root/check_dhcp.c4
-rwxr-xr-xplugins-scripts/check_log.sh4
-rwxr-xr-xplugins-scripts/check_oracle.sh16
-rwxr-xr-xplugins-scripts/check_sensors.sh8
-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/runcmd.c2
10 files changed, 24 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
index fdcad9f..02ca61e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -246,6 +246,7 @@ NP-VERSION-FILE
246/plugins-scripts/check_ircd 246/plugins-scripts/check_ircd
247/plugins-scripts/check_log 247/plugins-scripts/check_log
248/plugins-scripts/check_mailq 248/plugins-scripts/check_mailq
249/plugins-scripts/check_mssql
249/plugins-scripts/check_ntp 250/plugins-scripts/check_ntp
250/plugins-scripts/check_oracle 251/plugins-scripts/check_oracle
251/plugins-scripts/check_rpc 252/plugins-scripts/check_rpc
diff --git a/lib/utils_base.c b/lib/utils_base.c
index eb1823b..c458cf6 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -24,7 +24,7 @@
24* 24*
25*****************************************************************************/ 25*****************************************************************************/
26 26
27#include "common.h" 27#include "../plugins/common.h"
28#include <stdarg.h> 28#include <stdarg.h>
29#include "utils_base.h" 29#include "utils_base.h"
30#include <ctype.h> 30#include <ctype.h>
@@ -319,18 +319,18 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
319 319
320 while (1) { 320 while (1) {
321 /* Strip any leading space */ 321 /* Strip any leading space */
322 for (varlist; isspace(varlist[0]); varlist++); 322 for (; isspace(varlist[0]); varlist++);
323 323
324 if (strncmp(name, varlist, strlen(name)) == 0) { 324 if (strncmp(name, varlist, strlen(name)) == 0) {
325 varlist += strlen(name); 325 varlist += strlen(name);
326 /* strip trailing spaces */ 326 /* strip trailing spaces */
327 for (varlist; isspace(varlist[0]); varlist++); 327 for (; isspace(varlist[0]); varlist++);
328 328
329 if (varlist[0] == '=') { 329 if (varlist[0] == '=') {
330 /* We matched the key, go past the = sign */ 330 /* We matched the key, go past the = sign */
331 varlist++; 331 varlist++;
332 /* strip leading spaces */ 332 /* strip leading spaces */
333 for (varlist; isspace(varlist[0]); varlist++); 333 for (; isspace(varlist[0]); varlist++);
334 334
335 if (tmp = index(varlist, sep)) { 335 if (tmp = index(varlist, sep)) {
336 /* Value is delimited by a comma */ 336 /* Value is delimited by a comma */
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index ad67323..147db6b 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -470,10 +470,6 @@ int send_dhcp_discover(int sock){
470 packet_xid=random(); 470 packet_xid=random();
471 discover_packet.xid=htonl(packet_xid); 471 discover_packet.xid=htonl(packet_xid);
472 472
473 /**** WHAT THE HECK IS UP WITH THIS?!? IF I DON'T MAKE THIS CALL, ONLY ONE SERVER RESPONSE IS PROCESSED!!!! ****/
474 /* downright bizzarre... */
475 ntohl(discover_packet.xid);
476
477 /*discover_packet.secs=htons(65535);*/ 473 /*discover_packet.secs=htons(65535);*/
478 discover_packet.secs=0xFF; 474 discover_packet.secs=0xFF;
479 475
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
index c623a8d..8ecdd31 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -105,11 +105,11 @@ while test -n "$1"; do
105 case "$1" in 105 case "$1" in
106 -h | --help) 106 -h | --help)
107 print_help 107 print_help
108 exit "$STATE_OK" 108 exit "$STATE_UNKNOWN"
109 ;; 109 ;;
110 -V | --version) 110 -V | --version)
111 print_revision "$PROGNAME" "$REVISION" 111 print_revision "$PROGNAME" "$REVISION"
112 exit "$STATE_OK" 112 exit "$STATE_UNKNOWN"
113 ;; 113 ;;
114 -F | --filename) 114 -F | --filename)
115 logfile=$2 115 logfile=$2
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index b14ec50..5998138 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -86,20 +86,20 @@ esac
86# Information options 86# Information options
87case "$cmd" in 87case "$cmd" in
88--help) 88--help)
89 print_help 89 print_help
90 exit "$STATE_OK" 90 exit "$STATE_UNKNOWN"
91 ;; 91 ;;
92-h) 92-h)
93 print_help 93 print_help
94 exit "$STATE_OK" 94 exit "$STATE_UNKNOWN"
95 ;; 95 ;;
96--version) 96--version)
97 print_revision "$PROGNAME" "$REVISION" 97 print_revision "$PROGNAME" "$REVISION"
98 exit "$STATE_OK" 98 exit "$STATE_UNKNOWN"
99 ;; 99 ;;
100-V) 100-V)
101 print_revision "$PROGNAME" "$REVISION" 101 print_revision "$PROGNAME" "$REVISION"
102 exit "$STATE_OK" 102 exit "$STATE_UNKNOWN"
103 ;; 103 ;;
104esac 104esac
105 105
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
index 921e7b3..866e0e0 100755
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -26,19 +26,19 @@ print_help() {
26case "$1" in 26case "$1" in
27 --help) 27 --help)
28 print_help 28 print_help
29 exit "$STATE_OK" 29 exit "$STATE_UNKNOWN"
30 ;; 30 ;;
31 -h) 31 -h)
32 print_help 32 print_help
33 exit "$STATE_OK" 33 exit "$STATE_UNKNOWN"
34 ;; 34 ;;
35 --version) 35 --version)
36 print_revision "$PROGNAME" "$REVISION" 36 print_revision "$PROGNAME" "$REVISION"
37 exit "$STATE_OK" 37 exit "$STATE_UNKNOWN"
38 ;; 38 ;;
39 -V) 39 -V)
40 print_revision "$PROGNAME" "$REVISION" 40 print_revision "$PROGNAME" "$REVISION"
41 exit "$STATE_OK" 41 exit "$STATE_UNKNOWN"
42 ;; 42 ;;
43 *) 43 *)
44 sensordata=$(sensors 2>&1) 44 sensordata=$(sensors 2>&1)
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/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)