summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_dns.c2
-rw-r--r--plugins/check_game.c10
-rw-r--r--plugins/check_http.c12
-rw-r--r--plugins/check_ide-smart.c2
-rw-r--r--plugins/check_load.c15
-rw-r--r--plugins/check_mrtgtraf.c8
-rw-r--r--plugins/check_mysql.c2
-rw-r--r--plugins/check_nagios.c6
-rw-r--r--plugins/check_nt.c4
-rw-r--r--plugins/check_nwstat.c16
-rw-r--r--plugins/check_overcr.c6
-rw-r--r--plugins/check_pgsql.c2
-rw-r--r--plugins/check_ping.c4
-rw-r--r--plugins/check_procs.c2
-rw-r--r--plugins/check_radius.c2
-rw-r--r--plugins/check_real.c4
-rw-r--r--plugins/check_snmp.c2
-rw-r--r--plugins/check_ssh.c2
-rw-r--r--plugins/check_tcp.c18
-rw-r--r--plugins/check_time.c2
-rw-r--r--plugins/check_udp.c2
-rw-r--r--plugins/check_ups.c8
-rw-r--r--plugins/negate.c2
-rw-r--r--plugins/popen.c2
24 files changed, 62 insertions, 73 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index fa7fbc1..9ab001f 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -107,7 +107,7 @@ main (int argc, char **argv)
107 if ((temp_buffer = strstr (input_buffer, "name = "))) 107 if ((temp_buffer = strstr (input_buffer, "name = ")))
108 address = strdup (temp_buffer + 7); 108 address = strdup (temp_buffer + 7);
109 else { 109 else {
110 output = strdup (_("Unknown error (plugin)")); 110 output = strdup (_("Warning plugin error"));
111 result = STATE_WARNING; 111 result = STATE_WARNING;
112 } 112 }
113 } 113 }
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 8b2a6c4..3a8b9f5 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -67,7 +67,7 @@ main (int argc, char **argv)
67 67
68// result = process_arguments (argc, argv); 68// result = process_arguments (argc, argv);
69 69
70 if (process_arguments (argc, argv) == ERROR) 70 if (process_arguments (argc, argv) != OK)
71 usage (_("check_game: could not parse arguments\n")); 71 usage (_("check_game: could not parse arguments\n"));
72 72
73/* if (result != OK) { 73/* if (result != OK) {
@@ -116,7 +116,7 @@ main (int argc, char **argv)
116 */ 116 */
117 117
118 if (!strncmp (input_buffer, "unknown option", 14)) { 118 if (!strncmp (input_buffer, "unknown option", 14)) {
119 printf (_("ERROR: Host type parameter incorrect!\n")); 119 printf (_("CRITICAL - Host type parameter incorrect!\n"));
120 result = STATE_CRITICAL; 120 result = STATE_CRITICAL;
121 return result; 121 return result;
122 } 122 }
@@ -136,15 +136,15 @@ main (int argc, char **argv)
136 } 136 }
137 137
138 if (strstr (ret[2], QSTAT_HOST_ERROR)) { 138 if (strstr (ret[2], QSTAT_HOST_ERROR)) {
139 printf ("ERROR: Host not found\n"); 139 printf ("CRITICAL - Host not found\n");
140 result = STATE_CRITICAL; 140 result = STATE_CRITICAL;
141 } 141 }
142 else if (strstr (ret[2], QSTAT_HOST_DOWN)) { 142 else if (strstr (ret[2], QSTAT_HOST_DOWN)) {
143 printf ("ERROR: Game server down or unavailable\n"); 143 printf ("CRITICAL - Game server down or unavailable\n");
144 result = STATE_CRITICAL; 144 result = STATE_CRITICAL;
145 } 145 }
146 else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) { 146 else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) {
147 printf ("ERROR: Game server timeout\n"); 147 printf ("CRITICAL - Game server timeout\n");
148 result = STATE_CRITICAL; 148 result = STATE_CRITICAL;
149 } 149 }
150 else { 150 else {
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 748ca46..f5a6c2b 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -145,7 +145,7 @@ main (int argc, char **argv)
145 asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)", 145 asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)",
146 clean_revstring (revision), VERSION); 146 clean_revstring (revision), VERSION);
147 147
148 if (process_arguments (argc, argv) == ERROR) 148 if (process_arguments (argc, argv) != OK)
149 usage (_("check_http: could not parse arguments\n")); 149 usage (_("check_http: could not parse arguments\n"));
150 150
151 if (strstr (timestamp, ":")) { 151 if (strstr (timestamp, ":")) {
@@ -174,7 +174,7 @@ main (int argc, char **argv)
174 X509_free (server_cert); 174 X509_free (server_cert);
175 } 175 }
176 else { 176 else {
177 printf (_("ERROR: Cannot retrieve server certificate.\n")); 177 printf (_("CRITICAL - Cannot retrieve server certificate.\n"));
178 result = STATE_CRITICAL; 178 result = STATE_CRITICAL;
179 } 179 }
180 SSL_shutdown (ssl); 180 SSL_shutdown (ssl);
@@ -738,7 +738,7 @@ check_http (void)
738 X509_free (server_cert); 738 X509_free (server_cert);
739 } 739 }
740 else { 740 else {
741 printf (_("ERROR: Cannot retrieve server certificate.\n")); 741 printf (_("CRITICAL - Cannot retrieve server certificate.\n"));
742 return STATE_CRITICAL; 742 return STATE_CRITICAL;
743 } 743 }
744 744
@@ -1049,11 +1049,11 @@ redir (char *pos, char *status_line)
1049 1049
1050 addr = malloc (MAX_IPV4_HOSTLENGTH + 1); 1050 addr = malloc (MAX_IPV4_HOSTLENGTH + 1);
1051 if (addr == NULL) 1051 if (addr == NULL)
1052 die (STATE_UNKNOWN, _("ERROR: could not allocate addr\n")); 1052 die (STATE_UNKNOWN, _("could not allocate addr\n"));
1053 1053
1054 url = malloc (strcspn (pos, "\r\n")); 1054 url = malloc (strcspn (pos, "\r\n"));
1055 if (url == NULL) 1055 if (url == NULL)
1056 die (STATE_UNKNOWN, _("ERROR: could not allocate url\n")); 1056 die (STATE_UNKNOWN, _("could not allocate url\n"));
1057 1057
1058 while (pos) { 1058 while (pos) {
1059 1059
@@ -1073,7 +1073,7 @@ redir (char *pos, char *status_line)
1073 1073
1074 url = realloc (url, strcspn (pos, "\r\n")); 1074 url = realloc (url, strcspn (pos, "\r\n"));
1075 if (url == NULL) 1075 if (url == NULL)
1076 die (STATE_UNKNOWN, _("ERROR: could not allocate url\n")); 1076 die (STATE_UNKNOWN, _("could not allocate url\n"));
1077 1077
1078 /* URI_HTTP, URI_HOST, URI_PORT, URI_PATH */ 1078 /* URI_HTTP, URI_HOST, URI_PORT, URI_PATH */
1079 if (sscanf (pos, HD1, type, addr, port, url) == 4) { 1079 if (sscanf (pos, HD1, type, addr, port, url) == 4) {
diff --git a/plugins/check_ide-smart.c b/plugins/check_ide-smart.c
index 9d3c316..bcace8a 100644
--- a/plugins/check_ide-smart.c
+++ b/plugins/check_ide-smart.c
@@ -249,7 +249,7 @@ net_saint (values_t * p, thresholds_t * t)
249 total); 249 total);
250 break; 250 break;
251 case OPERATIONAL: 251 case OPERATIONAL:
252 printf (_("STATUS - Operational (%d/%d tests passed)\n"), passed, total); 252 printf (_("OK - Operational (%d/%d tests passed)\n"), passed, total);
253 break; 253 break;
254 default: 254 default:
255 printf (_("ERROR - Status '%d' uknown. %d/%d tests passed\n"), status, 255 printf (_("ERROR - Status '%d' uknown. %d/%d tests passed\n"), status,
diff --git a/plugins/check_load.c b/plugins/check_load.c
index babe84b..616c3e0 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -51,9 +51,6 @@ char *status_line;
51 51
52 52
53 53
54
55
56
57int 54int
58main (int argc, char **argv) 55main (int argc, char **argv)
59{ 56{
@@ -76,7 +73,7 @@ main (int argc, char **argv)
76 bindtextdomain (PACKAGE, LOCALEDIR); 73 bindtextdomain (PACKAGE, LOCALEDIR);
77 textdomain (PACKAGE); 74 textdomain (PACKAGE);
78 75
79 if (process_arguments (argc, argv) == ERROR) 76 if (process_arguments (argc, argv) != OK)
80 usage (_("check_load: could not parse arguments\n")); 77 usage (_("check_load: could not parse arguments\n"));
81 78
82#if HAVE_GETLOADAVG==1 79#if HAVE_GETLOADAVG==1
@@ -162,9 +159,6 @@ main (int argc, char **argv)
162 159
163 160
164 161
165
166
167
168/* process command-line arguments */ 162/* process command-line arguments */
169int 163int
170process_arguments (int argc, char **argv) 164process_arguments (int argc, char **argv)
@@ -223,7 +217,7 @@ process_arguments (int argc, char **argv)
223 usage (_("Critical threshold must be float or float triplet!\n")); 217 usage (_("Critical threshold must be float or float triplet!\n"));
224 break; 218 break;
225 case 'V': /* version */ 219 case 'V': /* version */
226 print_revision (progname, "$Revision$"); 220 print_revision (progname, revision);
227 exit (STATE_OK); 221 exit (STATE_OK);
228 case 'h': /* help */ 222 case 'h': /* help */
229 print_help (); 223 print_help ();
@@ -271,8 +265,6 @@ process_arguments (int argc, char **argv)
271 265
272 266
273 267
274
275
276int 268int
277validate_arguments (void) 269validate_arguments (void)
278{ 270{
@@ -299,9 +291,6 @@ validate_arguments (void)
299 291
300 292
301 293
302
303
304
305void 294void
306print_help (void) 295print_help (void)
307{ 296{
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 0b0f49e..b9c277b 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -191,7 +191,9 @@ main (int argc, char **argv)
191 191
192 return result; 192 return result;
193} 193}
194 194
195
196
195/* process command-line arguments */ 197/* process command-line arguments */
196int 198int
197process_arguments (int argc, char **argv) 199process_arguments (int argc, char **argv)
@@ -303,8 +305,6 @@ process_arguments (int argc, char **argv)
303 305
304 306
305 307
306
307
308int 308int
309validate_arguments (void) 309validate_arguments (void)
310{ 310{
@@ -313,8 +313,6 @@ validate_arguments (void)
313 313
314 314
315 315
316
317
318void 316void
319print_help (void) 317print_help (void)
320{ 318{
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index ffd96ed..703a1ba 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -39,6 +39,8 @@ int validate_arguments (void);
39void print_help (void); 39void print_help (void);
40void print_usage (void); 40void print_usage (void);
41 41
42
43
42int 44int
43main (int argc, char **argv) 45main (int argc, char **argv)
44{ 46{
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 4439251..bb2ae6d 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -65,7 +65,7 @@ main (int argc, char **argv)
65 bindtextdomain (PACKAGE, LOCALEDIR); 65 bindtextdomain (PACKAGE, LOCALEDIR);
66 textdomain (PACKAGE); 66 textdomain (PACKAGE);
67 67
68 if (process_arguments (argc, argv) == ERROR) 68 if (process_arguments (argc, argv) != OK)
69 usage (_("check_nagios: could not parse arguments\n")); 69 usage (_("check_nagios: could not parse arguments\n"));
70 70
71 /* Set signal handling and alarm */ 71 /* Set signal handling and alarm */
@@ -80,7 +80,7 @@ main (int argc, char **argv)
80 /* open the status log */ 80 /* open the status log */
81 fp = fopen (status_log, "r"); 81 fp = fopen (status_log, "r");
82 if (fp == NULL) { 82 if (fp == NULL) {
83 printf (_("ERROR - Cannot open status log for reading!\n")); 83 printf (_("CRITICAL - Cannot open status log for reading!\n"));
84 return STATE_CRITICAL; 84 return STATE_CRITICAL;
85 } 85 }
86 86
@@ -227,7 +227,7 @@ process_arguments (int argc, char **argv)
227 print_help (); 227 print_help ();
228 exit (STATE_OK); 228 exit (STATE_OK);
229 case 'V': /* version */ 229 case 'V': /* version */
230 print_revision (progname, "$Revision$"); 230 print_revision (progname, revision);
231 exit (STATE_OK); 231 exit (STATE_OK);
232 case 'F': /* status log */ 232 case 'F': /* status log */
233 status_log = optarg; 233 status_log = optarg;
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 84b78bc..15f3dc3 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -110,8 +110,8 @@ int main(int argc, char **argv){
110 bindtextdomain (PACKAGE, LOCALEDIR); 110 bindtextdomain (PACKAGE, LOCALEDIR);
111 textdomain (PACKAGE); 111 textdomain (PACKAGE);
112 112
113 if(process_arguments(argc,argv)==ERROR) 113 if(process_arguments(argc,argv) != OK)
114 usage(_("check_nt: could not parse arguments\n")); 114 usage (_("check_nt: could not parse arguments\n"));
115 115
116 /* initialize alarm signal handling */ 116 /* initialize alarm signal handling */
117 signal(SIGALRM,socket_timeout_alarm_handler); 117 signal(SIGALRM,socket_timeout_alarm_handler);
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index ec5d5d6..6a21f90 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -121,8 +121,8 @@ main(int argc, char **argv) {
121 bindtextdomain (PACKAGE, LOCALEDIR); 121 bindtextdomain (PACKAGE, LOCALEDIR);
122 textdomain (PACKAGE); 122 textdomain (PACKAGE);
123 123
124 if (process_arguments(argc,argv)==ERROR) 124 if (process_arguments(argc,argv) != OK)
125 usage(_("check_nwstat: could not parse arguments\n")); 125 usage (_("check_nwstat: could not parse arguments\n"));
126 126
127 /* initialize alarm signal handling */ 127 /* initialize alarm signal handling */
128 signal(SIGALRM,socket_timeout_alarm_handler); 128 signal(SIGALRM,socket_timeout_alarm_handler);
@@ -293,7 +293,7 @@ main(int argc, char **argv) {
293 return result; 293 return result;
294 294
295 if (!strcmp(recv_buffer,"-1\n")) { 295 if (!strcmp(recv_buffer,"-1\n")) {
296 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 296 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
297 result=STATE_CRITICAL; 297 result=STATE_CRITICAL;
298 } else { 298 } else {
299 free_disk_space=strtoul(recv_buffer,NULL,10); 299 free_disk_space=strtoul(recv_buffer,NULL,10);
@@ -318,7 +318,7 @@ main(int argc, char **argv) {
318 318
319 if (!strcmp(recv_buffer,"-1\n")) { 319 if (!strcmp(recv_buffer,"-1\n")) {
320 320
321 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 321 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
322 result=STATE_CRITICAL; 322 result=STATE_CRITICAL;
323 323
324 } else { 324 } else {
@@ -438,7 +438,7 @@ main(int argc, char **argv) {
438 return result; 438 return result;
439 439
440 if (!strcmp(recv_buffer,"-1\n")) { 440 if (!strcmp(recv_buffer,"-1\n")) {
441 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 441 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
442 result=STATE_CRITICAL; 442 result=STATE_CRITICAL;
443 } else { 443 } else {
444 purgeable_disk_space=strtoul(recv_buffer,NULL,10); 444 purgeable_disk_space=strtoul(recv_buffer,NULL,10);
@@ -459,7 +459,7 @@ main(int argc, char **argv) {
459 459
460 if (!strcmp(recv_buffer,"-1\n")) { 460 if (!strcmp(recv_buffer,"-1\n")) {
461 461
462 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 462 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
463 result=STATE_CRITICAL; 463 result=STATE_CRITICAL;
464 464
465 } else { 465 } else {
@@ -491,7 +491,7 @@ main(int argc, char **argv) {
491 return result; 491 return result;
492 492
493 if (!strcmp(recv_buffer,"-1\n")) { 493 if (!strcmp(recv_buffer,"-1\n")) {
494 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 494 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
495 result=STATE_CRITICAL; 495 result=STATE_CRITICAL;
496 } else { 496 } else {
497 non_purgeable_disk_space=strtoul(recv_buffer,NULL,10); 497 non_purgeable_disk_space=strtoul(recv_buffer,NULL,10);
@@ -512,7 +512,7 @@ main(int argc, char **argv) {
512 512
513 if (!strcmp(recv_buffer,"-1\n")) { 513 if (!strcmp(recv_buffer,"-1\n")) {
514 514
515 asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name); 515 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
516 result=STATE_CRITICAL; 516 result=STATE_CRITICAL;
517 517
518 } else { 518 } else {
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 6682d8e..fea87da 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -85,7 +85,7 @@ main (int argc, char **argv)
85 bindtextdomain (PACKAGE, LOCALEDIR); 85 bindtextdomain (PACKAGE, LOCALEDIR);
86 textdomain (PACKAGE); 86 textdomain (PACKAGE);
87 87
88 if (process_arguments (argc, argv) == ERROR) 88 if (process_arguments (argc, argv) != OK)
89 usage (_("check_overcr: could not parse arguments\n")); 89 usage (_("check_overcr: could not parse arguments\n"));
90 90
91 /* initialize alarm signal handling */ 91 /* initialize alarm signal handling */
@@ -180,7 +180,7 @@ main (int argc, char **argv)
180 /* error if we couldn't find the info for the disk */ 180 /* error if we couldn't find the info for the disk */
181 if (found_disk == FALSE) 181 if (found_disk == FALSE)
182 die (STATE_CRITICAL, 182 die (STATE_CRITICAL,
183 "Error: Disk '%s' non-existent or not mounted", 183 "CRITICAL - Disk '%s' non-existent or not mounted",
184 disk_name); 184 disk_name);
185 185
186 if (check_critical_value == TRUE && (percent_used_disk_space >= critical_value)) 186 if (check_critical_value == TRUE && (percent_used_disk_space >= critical_value))
@@ -339,7 +339,7 @@ process_arguments (int argc, char **argv)
339 print_help (); 339 print_help ();
340 exit (STATE_OK); 340 exit (STATE_OK);
341 case 'V': /* version */ 341 case 'V': /* version */
342 print_revision (progname, "$Revision$"); 342 print_revision (progname, revision);
343 exit (STATE_OK); 343 exit (STATE_OK);
344 case 'H': /* hostname */ 344 case 'H': /* hostname */
345 server_address = optarg; 345 server_address = optarg;
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 53ba295..bbf47f0 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -132,7 +132,7 @@ main (int argc, char **argv)
132 bindtextdomain (PACKAGE, LOCALEDIR); 132 bindtextdomain (PACKAGE, LOCALEDIR);
133 textdomain (PACKAGE); 133 textdomain (PACKAGE);
134 134
135 if (process_arguments (argc, argv) == ERROR) 135 if (process_arguments (argc, argv) != OK)
136 usage (_("check_pgsql: could not parse arguments\n")); 136 usage (_("check_pgsql: could not parse arguments\n"));
137 137
138 /* Set signal handling and alarm */ 138 /* Set signal handling and alarm */
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 260e1b6..0e09054 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -78,7 +78,7 @@ main (int argc, char **argv)
78 addresses = malloc (sizeof(char*) * max_addr); 78 addresses = malloc (sizeof(char*) * max_addr);
79 addresses[0] = NULL; 79 addresses[0] = NULL;
80 80
81 if (process_arguments (argc, argv) == ERROR) 81 if (process_arguments (argc, argv) != OK)
82 usage (_("check_ping: could not parse arguments\n")); 82 usage (_("check_ping: could not parse arguments\n"));
83 83
84 /* Set signal handling and alarm */ 84 /* Set signal handling and alarm */
@@ -121,7 +121,7 @@ main (int argc, char **argv)
121 if (pl == UNKNOWN_PACKET_LOSS || rta < 0.0) { 121 if (pl == UNKNOWN_PACKET_LOSS || rta < 0.0) {
122 printf ("%s\n", cmd); 122 printf ("%s\n", cmd);
123 die (STATE_UNKNOWN, 123 die (STATE_UNKNOWN,
124 _("Error: Could not interpret output from ping command\n")); 124 _("CRITICAL - Could not interpret output from ping command\n"));
125 } 125 }
126 126
127 if (pl >= cpl || rta >= crta || rta < 0) 127 if (pl >= cpl || rta >= crta || rta < 0)
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 011661c..b7f32c7 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -115,7 +115,7 @@ main (int argc, char **argv)
115 asprintf (&metric_name, "PROCS"); 115 asprintf (&metric_name, "PROCS");
116 metric = METRIC_PROCS; 116 metric = METRIC_PROCS;
117 117
118 if (process_arguments (argc, argv) == ERROR) 118 if (process_arguments (argc, argv) != OK)
119 usage (_("check_procs: could not parse arguments\n")); 119 usage (_("check_procs: could not parse arguments\n"));
120 120
121 /* Set signal handling and alarm timeout */ 121 /* Set signal handling and alarm timeout */
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 3e6bdca..b15ad6e 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -112,7 +112,7 @@ main (int argc, char **argv)
112 bindtextdomain (PACKAGE, LOCALEDIR); 112 bindtextdomain (PACKAGE, LOCALEDIR);
113 textdomain (PACKAGE); 113 textdomain (PACKAGE);
114 114
115 if (process_arguments (argc, argv) == ERROR) 115 if (process_arguments (argc, argv) != OK)
116 usage (_("check_radius: could not parse arguments\n")); 116 usage (_("check_radius: could not parse arguments\n"));
117 117
118 str = strdup ("dictionary"); 118 str = strdup ("dictionary");
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 3686ff4..59ad7d0 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -345,7 +345,7 @@ process_arguments (int argc, char **argv)
345 } 345 }
346 break; 346 break;
347 case 'V': /* version */ 347 case 'V': /* version */
348 print_revision (progname, "$Revision$"); 348 print_revision (progname, revision);
349 exit (STATE_OK); 349 exit (STATE_OK);
350 case 'h': /* help */ 350 case 'h': /* help */
351 print_help (); 351 print_help ();
@@ -395,7 +395,7 @@ print_help (void)
395 char *myport; 395 char *myport;
396 asprintf (&myport, "%d", PORT); 396 asprintf (&myport, "%d", PORT);
397 397
398 print_revision (progname, "$Revision$"); 398 print_revision (progname, revision);
399 399
400 printf ("Copyright (c) 1999 Pedro Leite <leite@cic.ua.pt>\n"); 400 printf ("Copyright (c) 1999 Pedro Leite <leite@cic.ua.pt>\n");
401 printf (COPYRIGHT, copyright, email); 401 printf (COPYRIGHT, copyright, email);
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 7d0ebc9..5167eb5 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -156,7 +156,7 @@ main (int argc, char **argv)
156 output_delim = strdup (DEFAULT_OUTPUT_DELIMITER); 156 output_delim = strdup (DEFAULT_OUTPUT_DELIMITER);
157 miblist = strdup (DEFAULT_MIBLIST); 157 miblist = strdup (DEFAULT_MIBLIST);
158 158
159 if (process_arguments (argc, argv) == ERROR) 159 if (process_arguments (argc, argv) != OK)
160 usage (_("check_snmp: could not parse arguments\n")); 160 usage (_("check_snmp: could not parse arguments\n"));
161 161
162 /* create the command line to execute */ 162 /* create the command line to execute */
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index b78443f..46dd044 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -57,7 +57,7 @@ main (int argc, char **argv)
57 bindtextdomain (PACKAGE, LOCALEDIR); 57 bindtextdomain (PACKAGE, LOCALEDIR);
58 textdomain (PACKAGE); 58 textdomain (PACKAGE);
59 59
60 if (process_arguments (argc, argv) == ERROR) 60 if (process_arguments (argc, argv) != OK)
61 usage (_("check_ssh: could not parse arguments\n")); 61 usage (_("check_ssh: could not parse arguments\n"));
62 62
63 /* initialize alarm signal handling */ 63 /* initialize alarm signal handling */
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 285932d..da70c5d 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -230,7 +230,7 @@ main (int argc, char **argv)
230 } 230 }
231 else { 231 else {
232 progname = strdup ("check_tcp"); 232 progname = strdup ("check_tcp");
233 usage (_("ERROR: Generic check_tcp called with unknown service\n")); 233 usage (_("CRITICAL - Generic check_tcp called with unknown service\n"));
234 } 234 }
235 235
236 server_address = strdup ("127.0.0.1"); 236 server_address = strdup ("127.0.0.1");
@@ -239,7 +239,7 @@ main (int argc, char **argv)
239 server_quit = QUIT; 239 server_quit = QUIT;
240 status = strdup (""); 240 status = strdup ("");
241 241
242 if (process_arguments (argc, argv) == ERROR) 242 if (process_arguments (argc, argv) != OK)
243 usage (_("check_tcp: could not parse arguments\n")); 243 usage (_("check_tcp: could not parse arguments\n"));
244 244
245 /* use default expect if none listed in process_arguments() */ 245 /* use default expect if none listed in process_arguments() */
@@ -259,13 +259,13 @@ main (int argc, char **argv)
259#ifdef HAVE_SSL 259#ifdef HAVE_SSL
260 if (use_ssl && check_cert == TRUE) { 260 if (use_ssl && check_cert == TRUE) {
261 if (connect_SSL () != OK) 261 if (connect_SSL () != OK)
262 die (STATE_CRITICAL,"TCP CRITICAL - Could not make SSL connection\n"); 262 die (STATE_CRITICAL,"CRITICAL - Could not make SSL connection\n");
263 if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { 263 if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) {
264 result = check_certificate (&server_cert); 264 result = check_certificate (&server_cert);
265 X509_free(server_cert); 265 X509_free(server_cert);
266 } 266 }
267 else { 267 else {
268 printf("ERROR: Cannot retrieve server certificate.\n"); 268 printf("CRITICAL Cannot retrieve server certificate.\n");
269 result = STATE_CRITICAL; 269 result = STATE_CRITICAL;
270 } 270 }
271 SSL_shutdown (ssl); 271 SSL_shutdown (ssl);
@@ -592,7 +592,7 @@ connect_SSL (void)
592 OpenSSL_add_all_algorithms(); 592 OpenSSL_add_all_algorithms();
593 if ((ctx = SSL_CTX_new (meth)) == NULL) 593 if ((ctx = SSL_CTX_new (meth)) == NULL)
594 { 594 {
595 printf (_("ERROR: Cannot create SSL context.\n")); 595 printf (_("CRITICAL - Cannot create SSL context.\n"));
596 return STATE_CRITICAL; 596 return STATE_CRITICAL;
597 } 597 }
598 598
@@ -615,13 +615,13 @@ connect_SSL (void)
615 if (SSL_connect(ssl) == 1) 615 if (SSL_connect(ssl) == 1)
616 return OK; 616 return OK;
617 /* ERR_print_errors_fp (stderr); */ 617 /* ERR_print_errors_fp (stderr); */
618 printf (_("ERROR: Cannot make SSL connection ")); 618 printf (_("CRITICAL - Cannot make SSL connection "));
619 ERR_print_errors_fp (stdout); 619 ERR_print_errors_fp (stdout);
620 /* printf("\n"); */ 620 /* printf("\n"); */
621 } 621 }
622 else 622 else
623 { 623 {
624 printf (_("ERROR: Cannot initiate SSL handshake.\n")); 624 printf (_("CRITICAL - Cannot initiate SSL handshake.\n"));
625 } 625 }
626 SSL_free (ssl); 626 SSL_free (ssl);
627 } 627 }
@@ -651,7 +651,7 @@ check_certificate (X509 ** certificate)
651 /* Generate tm structure to process timestamp */ 651 /* Generate tm structure to process timestamp */
652 if (tm->type == V_ASN1_UTCTIME) { 652 if (tm->type == V_ASN1_UTCTIME) {
653 if (tm->length < 10) { 653 if (tm->length < 10) {
654 printf ("ERROR: Wrong time format in certificate.\n"); 654 printf ("CRITICAL - Wrong time format in certificate.\n");
655 return STATE_CRITICAL; 655 return STATE_CRITICAL;
656 } 656 }
657 else { 657 else {
@@ -663,7 +663,7 @@ check_certificate (X509 ** certificate)
663 } 663 }
664 else { 664 else {
665 if (tm->length < 12) { 665 if (tm->length < 12) {
666 printf ("ERROR: Wrong time format in certificate.\n"); 666 printf ("CRITICAL - Wrong time format in certificate.\n");
667 return STATE_CRITICAL; 667 return STATE_CRITICAL;
668 } 668 }
669 else { 669 else {
diff --git a/plugins/check_time.c b/plugins/check_time.c
index 617b9e0..7c4fe41 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -124,7 +124,7 @@ main (int argc, char **argv)
124 else 124 else
125 result = STATE_UNKNOWN; 125 result = STATE_UNKNOWN;
126 die (result, 126 die (result,
127 _("TIME UNKNOWN - no data on recv() from server %s, port %d\n"), 127 _("TIME UNKNOWN - no data received from server %s, port %d\n"),
128 server_address, server_port); 128 server_address, server_port);
129 } 129 }
130 130
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 64ab83a..3706a72 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -51,7 +51,7 @@ main (int argc, char **argv)
51 bindtextdomain (PACKAGE, LOCALEDIR); 51 bindtextdomain (PACKAGE, LOCALEDIR);
52 textdomain (PACKAGE); 52 textdomain (PACKAGE);
53 53
54 if (process_arguments (argc, argv) == ERROR) 54 if (process_arguments (argc, argv) != OK)
55 usage (_("check_udp: could not parse arguments\n")); 55 usage (_("check_udp: could not parse arguments\n"));
56 56
57 /* initialize alarm signal handling */ 57 /* initialize alarm signal handling */
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 7f88ec3..0e23c53 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -396,20 +396,20 @@ get_ups_variable (const char *varname, char *buf, size_t buflen)
396 ptr = temp_buffer + strlen (varname) + 5; 396 ptr = temp_buffer + strlen (varname) + 5;
397 397
398 if (!strcmp (ptr, "NOT-SUPPORTED")) { 398 if (!strcmp (ptr, "NOT-SUPPORTED")) {
399 printf ("Error: Variable '%s' is not supported\n", varname); 399 printf ("CRITICAL - Variable '%s' is not supported\n", varname);
400 return ERROR; 400 return ERROR;
401 } 401 }
402 402
403 if (!strcmp (ptr, "DATA-STALE")) { 403 if (!strcmp (ptr, "DATA-STALE")) {
404 printf ("Error: UPS data is stale\n"); 404 printf ("CRITICAL - UPS data is stale\n");
405 return ERROR; 405 return ERROR;
406 } 406 }
407 407
408 if (!strcmp (ptr, "UNKNOWN-UPS")) { 408 if (!strcmp (ptr, "UNKNOWN-UPS")) {
409 if (ups_name) 409 if (ups_name)
410 printf ("Error: UPS '%s' is unknown\n", ups_name); 410 printf ("CRITICAL - UPS '%s' is unknown\n", ups_name);
411 else 411 else
412 printf ("Error: UPS is unknown\n"); 412 printf ("CRITICAL - UPS is unknown\n");
413 return ERROR; 413 return ERROR;
414 } 414 }
415 415
diff --git a/plugins/negate.c b/plugins/negate.c
index 9e5cf46..93ef46b 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -83,7 +83,7 @@ main (int argc, char **argv)
83 bindtextdomain (PACKAGE, LOCALEDIR); 83 bindtextdomain (PACKAGE, LOCALEDIR);
84 textdomain (PACKAGE); 84 textdomain (PACKAGE);
85 85
86 if (process_arguments (argc, argv) == ERROR) 86 if (process_arguments (argc, argv) != OK)
87 usage (_("negate: could not parse arguments\n")); 87 usage (_("negate: could not parse arguments\n"));
88 88
89 /* Set signal handling and alarm */ 89 /* Set signal handling and alarm */
diff --git a/plugins/popen.c b/plugins/popen.c
index d527c22..f05fe97 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -123,7 +123,7 @@ spopen (const char *cmdstring)
123 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ 123 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
124 124
125 if (i >= argc - 2) { 125 if (i >= argc - 2) {
126 printf ("You've got a big problem buddy! You need more args!!!\n"); 126 printf ("CRITICAL - You need more args!!!\n");
127 return (NULL); 127 return (NULL);
128 } 128 }
129 129