diff options
author | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-03 00:55:28 +0000 |
---|---|---|
committer | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-03 00:55:28 +0000 |
commit | 016d33230eb4fffd7e1f5644ce4901cb4d01f4e3 (patch) | |
tree | 1a6f29dcfd937bccffb66467127613b660d55365 | |
parent | 3f05eb7fcb71942c90fa7d5796c3d18ed62443cf (diff) | |
download | monitoring-plugins-016d33230eb4fffd7e1f5644ce4901cb4d01f4e3.tar.gz |
bump copyright year
initialize result to STATE_UNKNOW in place of STATE_OK
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@982 f882894a-f735-0410-b71e-b25c423dba1c
33 files changed, 118 insertions, 88 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index f569731d..d5bd3de4 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_by_ssh"; | 21 | const char *progname = "check_by_ssh"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 0102ea56..211c16c0 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
@@ -18,6 +18,11 @@ | |||
18 | 18 | ||
19 | *****************************************************************************/ | 19 | *****************************************************************************/ |
20 | 20 | ||
21 | const char *progname = "check_dig"; | ||
22 | const char *revision = "$Revision$"; | ||
23 | const char *copyright = "2002-2003"; | ||
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
25 | |||
21 | #include "common.h" | 26 | #include "common.h" |
22 | #include "netutils.h" | 27 | #include "netutils.h" |
23 | #include "utils.h" | 28 | #include "utils.h" |
@@ -28,11 +33,6 @@ int validate_arguments (void); | |||
28 | void print_help (void); | 33 | void print_help (void); |
29 | void print_usage (void); | 34 | void print_usage (void); |
30 | 35 | ||
31 | const char *progname = "check_dig"; | ||
32 | const char *revision = "$Revision$"; | ||
33 | const char *copyright = "2002-2003"; | ||
34 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
35 | |||
36 | enum { | 36 | enum { |
37 | UNDEFINED = 0, | 37 | UNDEFINED = 0, |
38 | DEFAULT_PORT = 53 | 38 | DEFAULT_PORT = 53 |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index aaa3f12d..6dfb09f2 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -21,16 +21,16 @@ | |||
21 | 21 | ||
22 | ******************************************************************************/ | 22 | ******************************************************************************/ |
23 | 23 | ||
24 | #include "common.h" | ||
25 | #include "popen.h" | ||
26 | #include "utils.h" | ||
27 | #include "netutils.h" | ||
28 | |||
29 | const char *progname = "check_dns"; | 24 | const char *progname = "check_dns"; |
30 | const char *revision = "$Revision$"; | 25 | const char *revision = "$Revision$"; |
31 | const char *copyright = "2000-2004"; | 26 | const char *copyright = "2000-2004"; |
32 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 27 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
33 | 28 | ||
29 | #include "common.h" | ||
30 | #include "popen.h" | ||
31 | #include "utils.h" | ||
32 | #include "netutils.h" | ||
33 | |||
34 | int process_arguments (int, char **); | 34 | int process_arguments (int, char **); |
35 | int validate_arguments (void); | 35 | int validate_arguments (void); |
36 | int error_scan (char *); | 36 | int error_scan (char *); |
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c index a99e38a7..6864d02d 100644 --- a/plugins/check_dummy.c +++ b/plugins/check_dummy.c | |||
@@ -18,14 +18,14 @@ | |||
18 | 18 | ||
19 | ******************************************************************************/ | 19 | ******************************************************************************/ |
20 | 20 | ||
21 | #include "common.h" | ||
22 | #include "utils.h" | ||
23 | |||
24 | const char *progname = "check_dummy"; | 21 | const char *progname = "check_dummy"; |
25 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
26 | const char *copyright = "1999-2003"; | 23 | const char *copyright = "1999-2004"; |
27 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
28 | 25 | ||
26 | #include "common.h" | ||
27 | #include "utils.h" | ||
28 | |||
29 | void print_help (void); | 29 | void print_help (void); |
30 | void print_usage (void); | 30 | void print_usage (void); |
31 | 31 | ||
@@ -34,7 +34,7 @@ void print_usage (void); | |||
34 | int | 34 | int |
35 | main (int argc, char **argv) | 35 | main (int argc, char **argv) |
36 | { | 36 | { |
37 | int result; | 37 | int result = STATE_UNKNOWN; |
38 | 38 | ||
39 | setlocale (LC_ALL, ""); | 39 | setlocale (LC_ALL, ""); |
40 | bindtextdomain (PACKAGE, LOCALEDIR); | 40 | bindtextdomain (PACKAGE, LOCALEDIR); |
diff --git a/plugins/check_fping.c b/plugins/check_fping.c index 817d647a..46d4bebc 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_fping"; | 21 | const char *progname = "check_fping"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -57,6 +57,8 @@ int wrta_p = FALSE; | |||
57 | int | 57 | int |
58 | main (int argc, char **argv) | 58 | main (int argc, char **argv) |
59 | { | 59 | { |
60 | /* normaly should be int result = STATE_UNKNOWN; */ | ||
61 | |||
60 | int status = STATE_UNKNOWN; | 62 | int status = STATE_UNKNOWN; |
61 | char *server = NULL; | 63 | char *server = NULL; |
62 | char *command_line = NULL; | 64 | char *command_line = NULL; |
diff --git a/plugins/check_game.c b/plugins/check_game.c index 89c212e8..ea08f9d9 100644 --- a/plugins/check_game.c +++ b/plugins/check_game.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | const char *progname = "check_game"; | 20 | const char *progname = "check_game"; |
21 | const char *revision = "$Revision$"; | 21 | const char *revision = "$Revision$"; |
22 | const char *copyright = "2002-2003"; | 22 | const char *copyright = "2002-2004"; |
23 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 23 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
24 | 24 | ||
25 | #include "common.h" | 25 | #include "common.h" |
@@ -55,7 +55,7 @@ int | |||
55 | main (int argc, char **argv) | 55 | main (int argc, char **argv) |
56 | { | 56 | { |
57 | char *command_line; | 57 | char *command_line; |
58 | int result; | 58 | int result = STATE_UNKNOWN; |
59 | FILE *fp; | 59 | FILE *fp; |
60 | char input_buffer[MAX_INPUT_BUFFER]; | 60 | char input_buffer[MAX_INPUT_BUFFER]; |
61 | char *p, *ret[QSTAT_MAX_RETURN_ARGS]; | 61 | char *p, *ret[QSTAT_MAX_RETURN_ARGS]; |
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 7c56e5dc..7ad950a4 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c | |||
@@ -17,6 +17,11 @@ | |||
17 | * $Id$ | 17 | * $Id$ |
18 | *****************************************************************************/ | 18 | *****************************************************************************/ |
19 | 19 | ||
20 | const char *progname = "check_hpjd"; | ||
21 | const char *revision = "$Revision$"; | ||
22 | const char *copyright = "2000-2004"; | ||
23 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
24 | |||
20 | #include "common.h" | 25 | #include "common.h" |
21 | #include "popen.h" | 26 | #include "popen.h" |
22 | #include "utils.h" | 27 | #include "utils.h" |
@@ -24,10 +29,6 @@ | |||
24 | 29 | ||
25 | #define DEFAULT_COMMUNITY "public" | 30 | #define DEFAULT_COMMUNITY "public" |
26 | 31 | ||
27 | const char *progname = "check_hpjd"; | ||
28 | const char *revision = "$Revision$"; | ||
29 | const char *copyright = "2000-2003"; | ||
30 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
31 | 32 | ||
32 | const char *option_summary = "-H host [-C community]\n"; | 33 | const char *option_summary = "-H host [-C community]\n"; |
33 | 34 | ||
@@ -59,7 +60,7 @@ int | |||
59 | main (int argc, char **argv) | 60 | main (int argc, char **argv) |
60 | { | 61 | { |
61 | char command_line[1024]; | 62 | char command_line[1024]; |
62 | int result; | 63 | int result = STATE_UNKNOWN; |
63 | int line; | 64 | int line; |
64 | char input_buffer[MAX_INPUT_BUFFER]; | 65 | char input_buffer[MAX_INPUT_BUFFER]; |
65 | char query_string[512]; | 66 | char query_string[512]; |
@@ -85,7 +86,7 @@ main (int argc, char **argv) | |||
85 | textdomain (PACKAGE); | 86 | textdomain (PACKAGE); |
86 | 87 | ||
87 | if (process_arguments (argc, argv) != TRUE) | 88 | if (process_arguments (argc, argv) != TRUE) |
88 | usage4 (_("Could not parse arguments\n")); | 89 | usage4 (_("Could not parse arguments")); |
89 | 90 | ||
90 | /* removed ' 2>1' at end of command 10/27/1999 - EG */ | 91 | /* removed ' 2>1' at end of command 10/27/1999 - EG */ |
91 | /* create the query string */ | 92 | /* create the query string */ |
diff --git a/plugins/check_ide-smart.c b/plugins/check_ide-smart.c index bcace8a0..09231aa0 100644 --- a/plugins/check_ide-smart.c +++ b/plugins/check_ide-smart.c | |||
@@ -36,9 +36,15 @@ | |||
36 | * | 36 | * |
37 | * $Id$ | 37 | * $Id$ |
38 | */ | 38 | */ |
39 | |||
40 | const char *progname = "check_ide_smart"; | ||
41 | const char *revision = "$Revision$"; | ||
42 | const char *copyright = "2000-2004"; | ||
43 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
39 | 44 | ||
40 | #include "common.h" | 45 | #include "common.h" |
41 | #include "utils.h" | 46 | #include "utils.h" |
47 | |||
42 | #include <sys/stat.h> | 48 | #include <sys/stat.h> |
43 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
44 | #include <fcntl.h> | 50 | #include <fcntl.h> |
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index b12a0edb..92d41a89 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_ldap"; | 21 | const char *progname = "check_ldap"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -64,7 +64,9 @@ main (int argc, char *argv[]) | |||
64 | LDAP *ld; | 64 | LDAP *ld; |
65 | LDAPMessage *result; | 65 | LDAPMessage *result; |
66 | 66 | ||
67 | int status; | 67 | /* should be int result = STATE_UNKNOWN; */ |
68 | |||
69 | int status = STATE_UNKNOW; | ||
68 | long microsec; | 70 | long microsec; |
69 | double elapsed_time; | 71 | double elapsed_time; |
70 | 72 | ||
diff --git a/plugins/check_load.c b/plugins/check_load.c index b918fa54..803467df 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_load"; | 21 | const char *progname = "check_load"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "1999-2003"; | 23 | const char *copyright = "1999-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -54,7 +54,8 @@ char *status_line; | |||
54 | int | 54 | int |
55 | main (int argc, char **argv) | 55 | main (int argc, char **argv) |
56 | { | 56 | { |
57 | int result; | 57 | int result = STATE_UNKNOWN; |
58 | |||
58 | #if HAVE_GETLOADAVG==1 | 59 | #if HAVE_GETLOADAVG==1 |
59 | double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about unitialized arrays */ | 60 | double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about unitialized arrays */ |
60 | #else | 61 | #else |
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index 31d132d4..7cf7d897 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_mrtg"; | 21 | const char *progname = "check_mrtg"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "1999-2001"; | 23 | const char *copyright = "1999-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -43,7 +43,7 @@ char *units; | |||
43 | int | 43 | int |
44 | main (int argc, char **argv) | 44 | main (int argc, char **argv) |
45 | { | 45 | { |
46 | int result = STATE_OK; | 46 | int result = STATE_UNKNOWN; |
47 | FILE *fp; | 47 | FILE *fp; |
48 | int line; | 48 | int line; |
49 | char input_buffer[MAX_INPUT_BUFFER]; | 49 | char input_buffer[MAX_INPUT_BUFFER]; |
@@ -152,7 +152,9 @@ main (int argc, char **argv) | |||
152 | 152 | ||
153 | return result; | 153 | return result; |
154 | } | 154 | } |
155 | 155 | ||
156 | |||
157 | |||
156 | /* process command-line arguments */ | 158 | /* process command-line arguments */ |
157 | int | 159 | int |
158 | process_arguments (int argc, char **argv) | 160 | process_arguments (int argc, char **argv) |
@@ -210,7 +212,7 @@ process_arguments (int argc, char **argv) | |||
210 | case 'v': | 212 | case 'v': |
211 | variable_number = atoi (optarg); | 213 | variable_number = atoi (optarg); |
212 | if (variable_number < 1 || variable_number > 2) | 214 | if (variable_number < 1 || variable_number > 2) |
213 | usage (_("Invalid variable number\n")); | 215 | usage4 (_("Invalid variable number")); |
214 | break; | 216 | break; |
215 | case 'w': /* critical time threshold */ | 217 | case 'w': /* critical time threshold */ |
216 | value_warning_threshold = strtoul (optarg, NULL, 10); | 218 | value_warning_threshold = strtoul (optarg, NULL, 10); |
@@ -291,7 +293,7 @@ int | |||
291 | validate_arguments (void) | 293 | validate_arguments (void) |
292 | { | 294 | { |
293 | if (variable_number == -1) | 295 | if (variable_number == -1) |
294 | usage (_("You must supply the variable number\n")); | 296 | usage4 (_("You must supply the variable number")); |
295 | 297 | ||
296 | if (label == NULL) | 298 | if (label == NULL) |
297 | label = strdup ("value"); | 299 | label = strdup ("value"); |
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c index 24ccaa93..f8d69552 100644 --- a/plugins/check_mrtgtraf.c +++ b/plugins/check_mrtgtraf.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | const char *progname = "check_mrtgtraf"; | 24 | const char *progname = "check_mrtgtraf"; |
25 | const char *revision = "$Revision$"; | 25 | const char *revision = "$Revision$"; |
26 | const char *copyright = "1999-2003"; | 26 | const char *copyright = "1999-2004"; |
27 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 27 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
28 | 28 | ||
29 | int process_arguments (int, char **); | 29 | int process_arguments (int, char **); |
@@ -43,7 +43,7 @@ unsigned long outgoing_critical_threshold = 0L; | |||
43 | int | 43 | int |
44 | main (int argc, char **argv) | 44 | main (int argc, char **argv) |
45 | { | 45 | { |
46 | int result = STATE_OK; | 46 | int result = STATE_UNKNOWN; |
47 | FILE *fp; | 47 | FILE *fp; |
48 | int line; | 48 | int line; |
49 | char input_buffer[MAX_INPUT_BUFFER]; | 49 | char input_buffer[MAX_INPUT_BUFFER]; |
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index f55630b2..30dce9d3 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | const char *progname = "check_mysql"; | 17 | const char *progname = "check_mysql"; |
18 | const char *revision = "$Revision$"; | 18 | const char *revision = "$Revision$"; |
19 | const char *copyright = "1999-2002"; | 19 | const char *copyright = "1999-2004"; |
20 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 20 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
21 | 21 | ||
22 | #define SLAVERESULTSIZE 40 | 22 | #define SLAVERESULTSIZE 40 |
@@ -24,6 +24,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; | |||
24 | #include "common.h" | 24 | #include "common.h" |
25 | #include "utils.h" | 25 | #include "utils.h" |
26 | #include "netutils.h" | 26 | #include "netutils.h" |
27 | |||
27 | #include <mysql/mysql.h> | 28 | #include <mysql/mysql.h> |
28 | #include <mysql/errmsg.h> | 29 | #include <mysql/errmsg.h> |
29 | 30 | ||
@@ -48,6 +49,9 @@ main (int argc, char **argv) | |||
48 | MYSQL mysql; | 49 | MYSQL mysql; |
49 | MYSQL_RES *res; | 50 | MYSQL_RES *res; |
50 | MYSQL_ROW row; | 51 | MYSQL_ROW row; |
52 | |||
53 | /* should be status */ | ||
54 | |||
51 | char *result = NULL; | 55 | char *result = NULL; |
52 | char slaveresult[SLAVERESULTSIZE]; | 56 | char slaveresult[SLAVERESULTSIZE]; |
53 | 57 | ||
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c index 618ee573..1daf5401 100644 --- a/plugins/check_nagios.c +++ b/plugins/check_nagios.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_nagios"; | 21 | const char *progname = "check_nagios"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "1999-2003"; | 23 | const char *copyright = "1999-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
diff --git a/plugins/check_nt.c b/plugins/check_nt.c index efd7cdef..f1426756 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c | |||
@@ -30,6 +30,11 @@ | |||
30 | * | 30 | * |
31 | *****************************************************************************/ | 31 | *****************************************************************************/ |
32 | 32 | ||
33 | const char *progname = "check_nt"; | ||
34 | const char *revision = "$Revision$"; | ||
35 | const char *copyright = "2003-2004"; | ||
36 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
37 | |||
33 | #include "common.h" | 38 | #include "common.h" |
34 | #include "netutils.h" | 39 | #include "netutils.h" |
35 | #include "utils.h" | 40 | #include "utils.h" |
@@ -65,8 +70,6 @@ int check_critical_value=FALSE; | |||
65 | enum checkvars vars_to_check = CHECK_NONE; | 70 | enum checkvars vars_to_check = CHECK_NONE; |
66 | int show_all=FALSE; | 71 | int show_all=FALSE; |
67 | 72 | ||
68 | const char *progname = "check_nt"; | ||
69 | |||
70 | char recv_buffer[MAX_INPUT_BUFFER]; | 73 | char recv_buffer[MAX_INPUT_BUFFER]; |
71 | 74 | ||
72 | void fetch_data (const char* address, int port, const char* sendb); | 75 | void fetch_data (const char* address, int port, const char* sendb); |
@@ -77,6 +80,9 @@ void print_help(void); | |||
77 | void print_usage(void); | 80 | void print_usage(void); |
78 | 81 | ||
79 | int main(int argc, char **argv){ | 82 | int main(int argc, char **argv){ |
83 | |||
84 | /* should be int result = STATE_UNKNOWN; */ | ||
85 | |||
80 | int return_code = STATE_UNKNOWN; | 86 | int return_code = STATE_UNKNOWN; |
81 | char *send_buffer=NULL; | 87 | char *send_buffer=NULL; |
82 | char *output_message=NULL; | 88 | char *output_message=NULL; |
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c index ce5773b9..41b7c870 100644 --- a/plugins/check_nwstat.c +++ b/plugins/check_nwstat.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_nwstat"; | 21 | const char *progname = "check_nwstat"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -84,7 +84,7 @@ void print_usage(void); | |||
84 | 84 | ||
85 | int | 85 | int |
86 | main(int argc, char **argv) { | 86 | main(int argc, char **argv) { |
87 | int result; | 87 | int result = STATE_UNKNOWN; |
88 | int sd; | 88 | int sd; |
89 | char *send_buffer=NULL; | 89 | char *send_buffer=NULL; |
90 | char recv_buffer[MAX_INPUT_BUFFER]; | 90 | char recv_buffer[MAX_INPUT_BUFFER]; |
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c index 22277f6e..ddaebdbd 100644 --- a/plugins/check_overcr.c +++ b/plugins/check_overcr.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_overcr"; | 21 | const char *progname = "check_overcr"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -63,7 +63,7 @@ void print_help (void); | |||
63 | int | 63 | int |
64 | main (int argc, char **argv) | 64 | main (int argc, char **argv) |
65 | { | 65 | { |
66 | int result; | 66 | int result = STATE_UNKNOWN; |
67 | char recv_buffer[MAX_INPUT_BUFFER]; | 67 | char recv_buffer[MAX_INPUT_BUFFER]; |
68 | char temp_buffer[MAX_INPUT_BUFFER]; | 68 | char temp_buffer[MAX_INPUT_BUFFER]; |
69 | char *temp_ptr = NULL; | 69 | char *temp_ptr = NULL; |
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index f9d66110..de76735b 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -18,6 +18,17 @@ | |||
18 | 18 | ||
19 | *****************************************************************************/ | 19 | *****************************************************************************/ |
20 | 20 | ||
21 | const char *progname = "check_pgsql"; | ||
22 | const char *revision = "$Revision$"; | ||
23 | const char *copyright = "1999-2004"; | ||
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
25 | |||
26 | #include "common.h" | ||
27 | #include "utils.h" | ||
28 | |||
29 | #include "netutils.h" | ||
30 | #include <libpq-fe.h> | ||
31 | |||
21 | #define DEFAULT_DB "template1" | 32 | #define DEFAULT_DB "template1" |
22 | #define DEFAULT_HOST "127.0.0.1" | 33 | #define DEFAULT_HOST "127.0.0.1" |
23 | 34 | ||
@@ -27,10 +38,7 @@ enum { | |||
27 | DEFAULT_CRIT = 8 | 38 | DEFAULT_CRIT = 8 |
28 | }; | 39 | }; |
29 | 40 | ||
30 | #include "common.h" | 41 | |
31 | #include "utils.h" | ||
32 | #include "netutils.h" | ||
33 | #include <libpq-fe.h> | ||
34 | 42 | ||
35 | int process_arguments (int, char **); | 43 | int process_arguments (int, char **); |
36 | int validate_arguments (void); | 44 | int validate_arguments (void); |
@@ -53,11 +61,6 @@ double tcrit = (double)DEFAULT_CRIT; | |||
53 | PGconn *conn; | 61 | PGconn *conn; |
54 | /*PGresult *res;*/ | 62 | /*PGresult *res;*/ |
55 | 63 | ||
56 | const char *progname = "check_pgsql"; | ||
57 | const char *revision = "$Revision$"; | ||
58 | const char *copyright = "1999-2003"; | ||
59 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
60 | |||
61 | 64 | ||
62 | /****************************************************************************** | 65 | /****************************************************************************** |
63 | 66 | ||
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index ecaf03ed..e3f5398b 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_ping"; | 21 | const char *progname = "check_ping"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 5448842c..4d01a1c2 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
@@ -20,12 +20,13 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_procs"; | 21 | const char *progname = "check_procs"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
27 | #include "popen.h" | 27 | #include "popen.h" |
28 | #include "utils.h" | 28 | #include "utils.h" |
29 | |||
29 | #include <pwd.h> | 30 | #include <pwd.h> |
30 | 31 | ||
31 | int process_arguments (int, char **); | 32 | int process_arguments (int, char **); |
diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 68ed4d88..57a3e407 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c | |||
@@ -104,7 +104,7 @@ main (int argc, char **argv) | |||
104 | UINT4 service; | 104 | UINT4 service; |
105 | char msg[BUFFER_LEN]; | 105 | char msg[BUFFER_LEN]; |
106 | SEND_DATA data; | 106 | SEND_DATA data; |
107 | int result; | 107 | int result = STATE_UNKNOWN; |
108 | UINT4 client_id; | 108 | UINT4 client_id; |
109 | char *str; | 109 | char *str; |
110 | 110 | ||
diff --git a/plugins/check_real.c b/plugins/check_real.c index 4ede6a5c..8a12a3e5 100644 --- a/plugins/check_real.c +++ b/plugins/check_real.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_real"; | 21 | const char *progname = "check_real"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -56,7 +56,7 @@ int | |||
56 | main (int argc, char **argv) | 56 | main (int argc, char **argv) |
57 | { | 57 | { |
58 | int sd; | 58 | int sd; |
59 | int result; | 59 | int result = STATE_UNKNOWN; |
60 | char buffer[MAX_INPUT_BUFFER]; | 60 | char buffer[MAX_INPUT_BUFFER]; |
61 | char *status_line = NULL; | 61 | char *status_line = NULL; |
62 | 62 | ||
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 257a38bb..c0ddc703 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_smtp"; | 21 | const char *progname = "check_smtp"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 6a41c6af..2e9ea63c 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_snmp"; | 21 | const char *progname = "check_snmp"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "1999-2003"; | 23 | const char *copyright = "1999-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 82d0acad..a21d64a4 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c | |||
@@ -18,15 +18,15 @@ | |||
18 | 18 | ||
19 | ******************************************************************************/ | 19 | ******************************************************************************/ |
20 | 20 | ||
21 | #include "common.h" | ||
22 | #include "netutils.h" | ||
23 | #include "utils.h" | ||
24 | |||
25 | const char *progname = "check_ssh"; | 21 | const char *progname = "check_ssh"; |
26 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
27 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
28 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
29 | 25 | ||
26 | #include "common.h" | ||
27 | #include "netutils.h" | ||
28 | #include "utils.h" | ||
29 | |||
30 | #ifndef MSG_DONTWAIT | 30 | #ifndef MSG_DONTWAIT |
31 | #define MSG_DONTWAIT 0 | 31 | #define MSG_DONTWAIT 0 |
32 | #endif | 32 | #endif |
@@ -51,7 +51,7 @@ int ssh_connect (char *haddr, int hport, char *remote_version); | |||
51 | int | 51 | int |
52 | main (int argc, char **argv) | 52 | main (int argc, char **argv) |
53 | { | 53 | { |
54 | int result; | 54 | int result = STATE_UNKNOWN; |
55 | 55 | ||
56 | setlocale (LC_ALL, ""); | 56 | setlocale (LC_ALL, ""); |
57 | bindtextdomain (PACKAGE, LOCALEDIR); | 57 | bindtextdomain (PACKAGE, LOCALEDIR); |
@@ -62,6 +62,7 @@ main (int argc, char **argv) | |||
62 | 62 | ||
63 | /* initialize alarm signal handling */ | 63 | /* initialize alarm signal handling */ |
64 | signal (SIGALRM, socket_timeout_alarm_handler); | 64 | signal (SIGALRM, socket_timeout_alarm_handler); |
65 | |||
65 | alarm (socket_timeout); | 66 | alarm (socket_timeout); |
66 | 67 | ||
67 | /* ssh_connect exits if error is found */ | 68 | /* ssh_connect exits if error is found */ |
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 608080ac..6857a01b 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
@@ -25,15 +25,15 @@ | |||
25 | * | 25 | * |
26 | *****************************************************************************/ | 26 | *****************************************************************************/ |
27 | 27 | ||
28 | #include "common.h" | ||
29 | #include "popen.h" | ||
30 | #include "utils.h" | ||
31 | |||
32 | const char *progname = "check_swap"; | 28 | const char *progname = "check_swap"; |
33 | const char *revision = "$Revision$"; | 29 | const char *revision = "$Revision$"; |
34 | const char *copyright = "2000-2003"; | 30 | const char *copyright = "2000-2004"; |
35 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 31 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
36 | 32 | ||
33 | #include "common.h" | ||
34 | #include "popen.h" | ||
35 | #include "utils.h" | ||
36 | |||
37 | int check_swap (int usp, long unsigned int free_swap); | 37 | int check_swap (int usp, long unsigned int free_swap); |
38 | int process_arguments (int argc, char **argv); | 38 | int process_arguments (int argc, char **argv); |
39 | int validate_arguments (void); | 39 | int validate_arguments (void); |
@@ -53,7 +53,7 @@ main (int argc, char **argv) | |||
53 | int percent_used, percent; | 53 | int percent_used, percent; |
54 | unsigned long long total_swap = 0, used_swap = 0, free_swap = 0; | 54 | unsigned long long total_swap = 0, used_swap = 0, free_swap = 0; |
55 | unsigned long long dsktotal = 0, dskused = 0, dskfree = 0, tmp = 0; | 55 | unsigned long long dsktotal = 0, dskused = 0, dskfree = 0, tmp = 0; |
56 | int result = STATE_OK; | 56 | int result = STATE_UNKNOWN; |
57 | char input_buffer[MAX_INPUT_BUFFER]; | 57 | char input_buffer[MAX_INPUT_BUFFER]; |
58 | char *perf; | 58 | char *perf; |
59 | int conv_factor = SWAP_CONVERSION; | 59 | int conv_factor = SWAP_CONVERSION; |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 119ccf10..05737764 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /* progname "check_tcp" changes depending on symlink called */ | 21 | /* progname "check_tcp" changes depending on symlink called */ |
22 | char *progname; | 22 | char *progname; |
23 | const char *revision = "$Revision$"; | 23 | const char *revision = "$Revision$"; |
24 | const char *copyright = "1999-2003"; | 24 | const char *copyright = "1999-2004"; |
25 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 25 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
26 | 26 | ||
27 | #include "common.h" | 27 | #include "common.h" |
@@ -105,7 +105,7 @@ char *buffer; | |||
105 | int | 105 | int |
106 | main (int argc, char **argv) | 106 | main (int argc, char **argv) |
107 | { | 107 | { |
108 | int result; | 108 | int result = STATE_UNKNOWN; |
109 | int i; | 109 | int i; |
110 | char *status; | 110 | char *status; |
111 | struct timeval tv; | 111 | struct timeval tv; |
diff --git a/plugins/check_time.c b/plugins/check_time.c index ee6ff438..8381fb2f 100644 --- a/plugins/check_time.c +++ b/plugins/check_time.c | |||
@@ -18,15 +18,15 @@ | |||
18 | 18 | ||
19 | ******************************************************************************/ | 19 | ******************************************************************************/ |
20 | 20 | ||
21 | #include "common.h" | ||
22 | #include "netutils.h" | ||
23 | #include "utils.h" | ||
24 | |||
25 | const char *progname = "check_time"; | 21 | const char *progname = "check_time"; |
26 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
27 | const char *copyright = "1999-2003"; | 23 | const char *copyright = "1999-2004"; |
28 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
29 | 25 | ||
26 | #include "common.h" | ||
27 | #include "netutils.h" | ||
28 | #include "utils.h" | ||
29 | |||
30 | enum { | 30 | enum { |
31 | TIME_PORT = 37 | 31 | TIME_PORT = 37 |
32 | }; | 32 | }; |
@@ -55,7 +55,7 @@ int | |||
55 | main (int argc, char **argv) | 55 | main (int argc, char **argv) |
56 | { | 56 | { |
57 | int sd; | 57 | int sd; |
58 | int result; | 58 | int result = STATE_UNKNOWN; |
59 | time_t conntime; | 59 | time_t conntime; |
60 | 60 | ||
61 | setlocale (LC_ALL, ""); | 61 | setlocale (LC_ALL, ""); |
diff --git a/plugins/check_udp.c b/plugins/check_udp.c index 5d671745..0cb732f9 100644 --- a/plugins/check_udp.c +++ b/plugins/check_udp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_udp"; | 21 | const char *progname = "check_udp"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "1999-2002"; | 23 | const char *copyright = "1999-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -44,7 +44,7 @@ char *server_send; | |||
44 | int | 44 | int |
45 | main (int argc, char **argv) | 45 | main (int argc, char **argv) |
46 | { | 46 | { |
47 | int result; | 47 | int result = STATE_UNKNOWN; |
48 | char recv_buffer[MAX_INPUT_BUFFER]; | 48 | char recv_buffer[MAX_INPUT_BUFFER]; |
49 | 49 | ||
50 | setlocale (LC_ALL, ""); | 50 | setlocale (LC_ALL, ""); |
@@ -63,6 +63,7 @@ main (int argc, char **argv) | |||
63 | time (&start_time); | 63 | time (&start_time); |
64 | result = process_udp_request (server_address, server_port, server_send, | 64 | result = process_udp_request (server_address, server_port, server_send, |
65 | recv_buffer, MAX_INPUT_BUFFER - 1); | 65 | recv_buffer, MAX_INPUT_BUFFER - 1); |
66 | |||
66 | time (&end_time); | 67 | time (&end_time); |
67 | 68 | ||
68 | if (result != STATE_OK) { | 69 | if (result != STATE_OK) { |
diff --git a/plugins/check_ups.c b/plugins/check_ups.c index e974b753..3e538bca 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | const char *progname = "check_ups"; | 30 | const char *progname = "check_ups"; |
31 | const char *revision = "$Revision$"; | 31 | const char *revision = "$Revision$"; |
32 | const char *copyright = "2000-2002"; | 32 | const char *copyright = "2000-2004"; |
33 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 33 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
34 | 34 | ||
35 | #include <locale.h> | 35 | #include <locale.h> |
@@ -96,7 +96,7 @@ void print_usage (void); | |||
96 | int | 96 | int |
97 | main (int argc, char **argv) | 97 | main (int argc, char **argv) |
98 | { | 98 | { |
99 | int result = STATE_OK; | 99 | int result = STATE_UNKNOWN; |
100 | char *message; | 100 | char *message; |
101 | char *data; | 101 | char *data; |
102 | char temp_buffer[MAX_INPUT_BUFFER]; | 102 | char temp_buffer[MAX_INPUT_BUFFER]; |
diff --git a/plugins/check_users.c b/plugins/check_users.c index 891fe3b7..d0893225 100644 --- a/plugins/check_users.c +++ b/plugins/check_users.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "check_users"; | 21 | const char *progname = "check_users"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |
@@ -40,7 +40,7 @@ int | |||
40 | main (int argc, char **argv) | 40 | main (int argc, char **argv) |
41 | { | 41 | { |
42 | int users = -1; | 42 | int users = -1; |
43 | int result = STATE_OK; | 43 | int result = STATE_UNKNOWN; |
44 | char input_buffer[MAX_INPUT_BUFFER]; | 44 | char input_buffer[MAX_INPUT_BUFFER]; |
45 | char *perf; | 45 | char *perf; |
46 | 46 | ||
diff --git a/plugins/negate.c b/plugins/negate.c index 9e25ebc5..e0f99750 100644 --- a/plugins/negate.c +++ b/plugins/negate.c | |||
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | const char *progname = "negate"; | 56 | const char *progname = "negate"; |
57 | const char *revision = "$Revision$"; | 57 | const char *revision = "$Revision$"; |
58 | const char *copyright = "2002-2003"; | 58 | const char *copyright = "2002-2004"; |
59 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 59 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
60 | 60 | ||
61 | #define DEFAULT_TIMEOUT 9 | 61 | #define DEFAULT_TIMEOUT 9 |
diff --git a/plugins/urlize.c b/plugins/urlize.c index 9973c1a3..65a7b3dd 100644 --- a/plugins/urlize.c +++ b/plugins/urlize.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const char *progname = "urlize"; | 21 | const char *progname = "urlize"; |
22 | const char *revision = "$Revision$"; | 22 | const char *revision = "$Revision$"; |
23 | const char *copyright = "2000-2003"; | 23 | const char *copyright = "2000-2004"; |
24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 24 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
25 | 25 | ||
26 | #include "common.h" | 26 | #include "common.h" |