summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Mortier <opensides@users.sourceforge.net>2004-12-03 00:55:28 (GMT)
committerBenoit Mortier <opensides@users.sourceforge.net>2004-12-03 00:55:28 (GMT)
commit016d33230eb4fffd7e1f5644ce4901cb4d01f4e3 (patch)
tree1a6f29dcfd937bccffb66467127613b660d55365
parent3f05eb7fcb71942c90fa7d5796c3d18ed62443cf (diff)
downloadmonitoring-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
-rw-r--r--plugins/check_by_ssh.c2
-rw-r--r--plugins/check_dig.c10
-rw-r--r--plugins/check_dns.c10
-rw-r--r--plugins/check_dummy.c10
-rw-r--r--plugins/check_fping.c4
-rw-r--r--plugins/check_game.c4
-rw-r--r--plugins/check_hpjd.c13
-rw-r--r--plugins/check_ide-smart.c6
-rw-r--r--plugins/check_ldap.c6
-rw-r--r--plugins/check_load.c5
-rw-r--r--plugins/check_mrtg.c12
-rw-r--r--plugins/check_mrtgtraf.c4
-rw-r--r--plugins/check_mysql.c6
-rw-r--r--plugins/check_nagios.c2
-rw-r--r--plugins/check_nt.c10
-rw-r--r--plugins/check_nwstat.c4
-rw-r--r--plugins/check_overcr.c4
-rw-r--r--plugins/check_pgsql.c21
-rw-r--r--plugins/check_ping.c2
-rw-r--r--plugins/check_procs.c3
-rw-r--r--plugins/check_radius.c2
-rw-r--r--plugins/check_real.c4
-rw-r--r--plugins/check_smtp.c2
-rw-r--r--plugins/check_snmp.c2
-rw-r--r--plugins/check_ssh.c13
-rw-r--r--plugins/check_swap.c12
-rw-r--r--plugins/check_tcp.c4
-rw-r--r--plugins/check_time.c12
-rw-r--r--plugins/check_udp.c5
-rw-r--r--plugins/check_ups.c4
-rw-r--r--plugins/check_users.c4
-rw-r--r--plugins/negate.c2
-rw-r--r--plugins/urlize.c2
33 files changed, 118 insertions, 88 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index f569731..d5bd3de 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_by_ssh"; 21const char *progname = "check_by_ssh";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 0102ea5..211c16c 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -18,6 +18,11 @@
18 18
19*****************************************************************************/ 19*****************************************************************************/
20 20
21const char *progname = "check_dig";
22const char *revision = "$Revision$";
23const char *copyright = "2002-2003";
24const 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);
28void print_help (void); 33void print_help (void);
29void print_usage (void); 34void print_usage (void);
30 35
31const char *progname = "check_dig";
32const char *revision = "$Revision$";
33const char *copyright = "2002-2003";
34const char *email = "nagiosplug-devel@lists.sourceforge.net";
35
36enum { 36enum {
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 aaa3f12..6dfb09f 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
29const char *progname = "check_dns"; 24const char *progname = "check_dns";
30const char *revision = "$Revision$"; 25const char *revision = "$Revision$";
31const char *copyright = "2000-2004"; 26const char *copyright = "2000-2004";
32const char *email = "nagiosplug-devel@lists.sourceforge.net"; 27const 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
34int process_arguments (int, char **); 34int process_arguments (int, char **);
35int validate_arguments (void); 35int validate_arguments (void);
36int error_scan (char *); 36int error_scan (char *);
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c
index a99e38a..6864d02 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
24const char *progname = "check_dummy"; 21const char *progname = "check_dummy";
25const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
26const char *copyright = "1999-2003"; 23const char *copyright = "1999-2004";
27const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
28 25
26#include "common.h"
27#include "utils.h"
28
29void print_help (void); 29void print_help (void);
30void print_usage (void); 30void print_usage (void);
31 31
@@ -34,7 +34,7 @@ void print_usage (void);
34int 34int
35main (int argc, char **argv) 35main (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 817d647..46d4beb 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_fping"; 21const char *progname = "check_fping";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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;
57int 57int
58main (int argc, char **argv) 58main (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 89c212e..ea08f9d 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -19,7 +19,7 @@
19 19
20const char *progname = "check_game"; 20const char *progname = "check_game";
21const char *revision = "$Revision$"; 21const char *revision = "$Revision$";
22const char *copyright = "2002-2003"; 22const char *copyright = "2002-2004";
23const char *email = "nagiosplug-devel@lists.sourceforge.net"; 23const char *email = "nagiosplug-devel@lists.sourceforge.net";
24 24
25#include "common.h" 25#include "common.h"
@@ -55,7 +55,7 @@ int
55main (int argc, char **argv) 55main (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 7c56e5d..7ad950a 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -17,6 +17,11 @@
17* $Id$ 17* $Id$
18*****************************************************************************/ 18*****************************************************************************/
19 19
20const char *progname = "check_hpjd";
21const char *revision = "$Revision$";
22const char *copyright = "2000-2004";
23const 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
27const char *progname = "check_hpjd";
28const char *revision = "$Revision$";
29const char *copyright = "2000-2003";
30const char *email = "nagiosplug-devel@lists.sourceforge.net";
31 32
32const char *option_summary = "-H host [-C community]\n"; 33const char *option_summary = "-H host [-C community]\n";
33 34
@@ -59,7 +60,7 @@ int
59main (int argc, char **argv) 60main (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 bcace8a..09231aa 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
40const char *progname = "check_ide_smart";
41const char *revision = "$Revision$";
42const char *copyright = "2000-2004";
43const 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 b12a0ed..92d41a8 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_ldap"; 21const char *progname = "check_ldap";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 b918fa5..803467d 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_load"; 21const char *progname = "check_load";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "1999-2003"; 23const char *copyright = "1999-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -54,7 +54,8 @@ char *status_line;
54int 54int
55main (int argc, char **argv) 55main (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 31d132d..7cf7d89 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_mrtg"; 21const char *progname = "check_mrtg";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "1999-2001"; 23const char *copyright = "1999-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -43,7 +43,7 @@ char *units;
43int 43int
44main (int argc, char **argv) 44main (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 */
157int 159int
158process_arguments (int argc, char **argv) 160process_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
291validate_arguments (void) 293validate_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 24ccaa9..f8d6955 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -23,7 +23,7 @@
23 23
24const char *progname = "check_mrtgtraf"; 24const char *progname = "check_mrtgtraf";
25const char *revision = "$Revision$"; 25const char *revision = "$Revision$";
26const char *copyright = "1999-2003"; 26const char *copyright = "1999-2004";
27const char *email = "nagiosplug-devel@lists.sourceforge.net"; 27const char *email = "nagiosplug-devel@lists.sourceforge.net";
28 28
29int process_arguments (int, char **); 29int process_arguments (int, char **);
@@ -43,7 +43,7 @@ unsigned long outgoing_critical_threshold = 0L;
43int 43int
44main (int argc, char **argv) 44main (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 f55630b..30dce9d 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -16,7 +16,7 @@
16 16
17const char *progname = "check_mysql"; 17const char *progname = "check_mysql";
18const char *revision = "$Revision$"; 18const char *revision = "$Revision$";
19const char *copyright = "1999-2002"; 19const char *copyright = "1999-2004";
20const char *email = "nagiosplug-devel@lists.sourceforge.net"; 20const 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 618ee57..1daf540 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_nagios"; 21const char *progname = "check_nagios";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "1999-2003"; 23const char *copyright = "1999-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 efd7cde..f142675 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -30,6 +30,11 @@
30 * 30 *
31 *****************************************************************************/ 31 *****************************************************************************/
32 32
33const char *progname = "check_nt";
34const char *revision = "$Revision$";
35const char *copyright = "2003-2004";
36const 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;
65enum checkvars vars_to_check = CHECK_NONE; 70enum checkvars vars_to_check = CHECK_NONE;
66int show_all=FALSE; 71int show_all=FALSE;
67 72
68const char *progname = "check_nt";
69
70char recv_buffer[MAX_INPUT_BUFFER]; 73char recv_buffer[MAX_INPUT_BUFFER];
71 74
72void fetch_data (const char* address, int port, const char* sendb); 75void fetch_data (const char* address, int port, const char* sendb);
@@ -77,6 +80,9 @@ void print_help(void);
77void print_usage(void); 80void print_usage(void);
78 81
79int main(int argc, char **argv){ 82int 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 ce5773b..41b7c87 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_nwstat"; 21const char *progname = "check_nwstat";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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
85int 85int
86main(int argc, char **argv) { 86main(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 22277f6..ddaebdb 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_overcr"; 21const char *progname = "check_overcr";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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);
63int 63int
64main (int argc, char **argv) 64main (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 f9d6611..de76735 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -18,6 +18,17 @@
18 18
19 *****************************************************************************/ 19 *****************************************************************************/
20 20
21const char *progname = "check_pgsql";
22const char *revision = "$Revision$";
23const char *copyright = "1999-2004";
24const 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
35int process_arguments (int, char **); 43int process_arguments (int, char **);
36int validate_arguments (void); 44int validate_arguments (void);
@@ -53,11 +61,6 @@ double tcrit = (double)DEFAULT_CRIT;
53PGconn *conn; 61PGconn *conn;
54/*PGresult *res;*/ 62/*PGresult *res;*/
55 63
56const char *progname = "check_pgsql";
57const char *revision = "$Revision$";
58const char *copyright = "1999-2003";
59const 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 ecaf03e..e3f5398 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_ping"; 21const char *progname = "check_ping";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 5448842..4d01a1c 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -20,12 +20,13 @@
20 20
21const char *progname = "check_procs"; 21const char *progname = "check_procs";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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
31int process_arguments (int, char **); 32int process_arguments (int, char **);
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 68ed4d8..57a3e40 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 4ede6a5..8a12a3e 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_real"; 21const char *progname = "check_real";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -56,7 +56,7 @@ int
56main (int argc, char **argv) 56main (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 257a38b..c0ddc70 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_smtp"; 21const char *progname = "check_smtp";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 6a41c6a..2e9ea63 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_snmp"; 21const char *progname = "check_snmp";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "1999-2003"; 23const char *copyright = "1999-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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 82d0aca..a21d64a 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
25const char *progname = "check_ssh"; 21const char *progname = "check_ssh";
26const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
27const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
28const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const 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);
51int 51int
52main (int argc, char **argv) 52main (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 608080a..6857a01 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
32const char *progname = "check_swap"; 28const char *progname = "check_swap";
33const char *revision = "$Revision$"; 29const char *revision = "$Revision$";
34const char *copyright = "2000-2003"; 30const char *copyright = "2000-2004";
35const char *email = "nagiosplug-devel@lists.sourceforge.net"; 31const char *email = "nagiosplug-devel@lists.sourceforge.net";
36 32
33#include "common.h"
34#include "popen.h"
35#include "utils.h"
36
37int check_swap (int usp, long unsigned int free_swap); 37int check_swap (int usp, long unsigned int free_swap);
38int process_arguments (int argc, char **argv); 38int process_arguments (int argc, char **argv);
39int validate_arguments (void); 39int 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 119ccf1..0573776 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 */
22char *progname; 22char *progname;
23const char *revision = "$Revision$"; 23const char *revision = "$Revision$";
24const char *copyright = "1999-2003"; 24const char *copyright = "1999-2004";
25const char *email = "nagiosplug-devel@lists.sourceforge.net"; 25const char *email = "nagiosplug-devel@lists.sourceforge.net";
26 26
27#include "common.h" 27#include "common.h"
@@ -105,7 +105,7 @@ char *buffer;
105int 105int
106main (int argc, char **argv) 106main (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 ee6ff43..8381fb2 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
25const char *progname = "check_time"; 21const char *progname = "check_time";
26const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
27const char *copyright = "1999-2003"; 23const char *copyright = "1999-2004";
28const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
29 25
26#include "common.h"
27#include "netutils.h"
28#include "utils.h"
29
30enum { 30enum {
31 TIME_PORT = 37 31 TIME_PORT = 37
32}; 32};
@@ -55,7 +55,7 @@ int
55main (int argc, char **argv) 55main (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 5d67174..0cb732f 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_udp"; 21const char *progname = "check_udp";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "1999-2002"; 23const char *copyright = "1999-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -44,7 +44,7 @@ char *server_send;
44int 44int
45main (int argc, char **argv) 45main (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 e974b75..3e538bc 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -29,7 +29,7 @@
29 29
30const char *progname = "check_ups"; 30const char *progname = "check_ups";
31const char *revision = "$Revision$"; 31const char *revision = "$Revision$";
32const char *copyright = "2000-2002"; 32const char *copyright = "2000-2004";
33const char *email = "nagiosplug-devel@lists.sourceforge.net"; 33const 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);
96int 96int
97main (int argc, char **argv) 97main (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 891fe3b..d089322 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_users"; 21const char *progname = "check_users";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -40,7 +40,7 @@ int
40main (int argc, char **argv) 40main (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 9e25ebc..e0f9975 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -55,7 +55,7 @@
55 55
56const char *progname = "negate"; 56const char *progname = "negate";
57const char *revision = "$Revision$"; 57const char *revision = "$Revision$";
58const char *copyright = "2002-2003"; 58const char *copyright = "2002-2004";
59const char *email = "nagiosplug-devel@lists.sourceforge.net"; 59const 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 9973c1a..65a7b3d 100644
--- a/plugins/urlize.c
+++ b/plugins/urlize.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "urlize"; 21const char *progname = "urlize";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2000-2003"; 23const char *copyright = "2000-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"