summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Mortier <opensides@users.sourceforge.net>2004-12-02 00:30:32 (GMT)
committerBenoit Mortier <opensides@users.sourceforge.net>2004-12-02 00:30:32 (GMT)
commit2d1ba3e36b950f05832ea2bd595616fa6cd28c28 (patch)
treeb988b2331b6dd9b8072fa4055b8287bd92c0c799
parentd19edd4043c498626fe68308005947975ef0a697 (diff)
downloadmonitoring-plugins-2d1ba3e36b950f05832ea2bd595616fa6cd28c28.tar.gz
adapted for localization
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@970 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--contrib/check_rbl.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/check_rbl.c b/contrib/check_rbl.c
index 69fdd23..6831b65 100644
--- a/contrib/check_rbl.c
+++ b/contrib/check_rbl.c
@@ -22,6 +22,9 @@
22#include "string.h" 22#include "string.h"
23 23
24const char progname = "check_rbl"; 24const char progname = "check_rbl";
25const char *revision = "$Revision$";
26//const char *copyright = "2000-2003";
27//const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 28
26int process_arguments(int, char **); 29int process_arguments(int, char **);
27int call_getopt(int, char **); 30int call_getopt(int, char **);
@@ -48,7 +51,7 @@ int main(int argc, char **argv){
48 usage("Cannot catch SIGALRM\n"); 51 usage("Cannot catch SIGALRM\n");
49 52
50 if (process_arguments(argc,argv)!=OK) 53 if (process_arguments(argc,argv)!=OK)
51 usage("Could not parse arguments\n"); 54 usage (_("check_rbl: could not parse arguments\n"));
52 55
53 /* reverse the octets in the IP address */ 56 /* reverse the octets in the IP address */
54 query_address_rev = reverse_ipaddr(query_address); 57 query_address_rev = reverse_ipaddr(query_address);
@@ -127,7 +130,7 @@ int main(int argc, char **argv){
127 if (spclose(child_process)) { 130 if (spclose(child_process)) {
128 result=error_set(result,STATE_WARNING); 131 result=error_set(result,STATE_WARNING);
129 if (!strcmp(output,"")) 132 if (!strcmp(output,""))
130 strcpy(output,"nslookup returned error status"); 133 strcpy(output,"nslookup returned an error status");
131 } 134 }
132 135
133 (void)time(&end_time); 136 (void)time(&end_time);
@@ -144,6 +147,8 @@ int main(int argc, char **argv){
144 return result; 147 return result;
145} 148}
146 149
150
151
147/* reverse the ipaddr */ 152/* reverse the ipaddr */
148char *reverse_ipaddr(char *ipaddr) 153char *reverse_ipaddr(char *ipaddr)
149{ 154{
@@ -160,6 +165,7 @@ char *reverse_ipaddr(char *ipaddr)
160} 165}
161 166
162 167
168
163/* process command-line arguments */ 169/* process command-line arguments */
164int process_arguments(int argc, char **argv) 170int process_arguments(int argc, char **argv)
165{ 171{
@@ -189,9 +195,6 @@ int process_arguments(int argc, char **argv)
189 195
190 196
191 197
192
193
194
195int call_getopt(int argc, char **argv) 198int call_getopt(int argc, char **argv)
196{ 199{
197 int c,i=0; 200 int c,i=0;
@@ -266,7 +269,9 @@ int call_getopt(int argc, char **argv)
266 print_help(); 269 print_help();
267 exit(STATE_OK); 270 exit(STATE_OK);
268 case '?': /* help */ 271 case '?': /* help */
269 usage("Invalid argument\n"); 272 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
273 print_usage ();
274 exit (STATE_UNKNOWN);
270 } 275 }
271 } 276 }
272 return i; 277 return i;
@@ -274,8 +279,6 @@ int call_getopt(int argc, char **argv)
274 279
275 280
276 281
277
278
279int validate_arguments(void) 282int validate_arguments(void)
280{ 283{
281 if (query_address == NULL || rbl_name == NULL) 284 if (query_address == NULL || rbl_name == NULL)
@@ -286,8 +289,6 @@ int validate_arguments(void)
286 289
287 290
288 291
289
290
291void print_help(void) 292void print_help(void)
292{ 293{
293 print_revision(progname,"$Revision$"); 294 print_revision(progname,"$Revision$");
@@ -317,8 +318,6 @@ void print_help(void)
317 318
318 319
319 320
320
321
322void print_usage(void) 321void print_usage(void)
323{ 322{
324 printf 323 printf