aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins-root/check_dhcp.c2
-rw-r--r--plugins/check_apt.c2
-rw-r--r--plugins/check_by_ssh.c2
-rw-r--r--plugins/check_dig.c4
-rw-r--r--plugins/check_dns.c2
-rw-r--r--plugins/check_fping.c2
-rw-r--r--plugins/check_game.c2
-rw-r--r--plugins/check_hpjd.c2
-rw-r--r--plugins/check_http.c2
-rw-r--r--plugins/check_ide_smart.c2
-rw-r--r--plugins/check_ldap.c2
-rw-r--r--plugins/check_load.c2
-rw-r--r--plugins/check_mrtg.c2
-rw-r--r--plugins/check_mrtgtraf.c2
-rw-r--r--plugins/check_mysql.c2
-rw-r--r--plugins/check_mysql_query.c2
-rw-r--r--plugins/check_nagios.c2
-rw-r--r--plugins/check_nt.c2
-rw-r--r--plugins/check_ntp.c2
-rw-r--r--plugins/check_nwstat.c2
-rw-r--r--plugins/check_overcr.c2
-rw-r--r--plugins/check_pgsql.c2
-rw-r--r--plugins/check_ping.c2
-rw-r--r--plugins/check_procs.c2
-rw-r--r--plugins/check_radius.c2
-rw-r--r--plugins/check_real.c2
-rw-r--r--plugins/check_smtp.c2
-rw-r--r--plugins/check_snmp.c2
-rw-r--r--plugins/check_ssh.c2
-rw-r--r--plugins/check_swap.c2
-rw-r--r--plugins/check_tcp.c2
-rw-r--r--plugins/check_time.c2
-rw-r--r--plugins/check_ups.c2
-rw-r--r--plugins/check_users.c2
-rw-r--r--plugins/negate.c2
-rw-r--r--plugins/urlize.c2
-rw-r--r--plugins/utils.c7
-rw-r--r--plugins/utils.h5
38 files changed, 47 insertions, 39 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index fbfb3311..245946b5 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -1091,7 +1091,7 @@ int call_getopt(int argc, char **argv){
break;
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
break;
default:
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index 902b455f..f67ebf9b 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -201,7 +201,7 @@ int process_arguments (int argc, char **argv) {
break;
default:
/* print short usage statement if args not parsable */
- usage_va(_("Unknown argument - %s"), optarg);
+ usage5();
}
}
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index d1cbf936..1675071c 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -262,7 +262,7 @@ process_arguments (int argc, char **argv)
asprintf (&comm, "%s -%c", comm, c);
break;
default: /* help */
- usage_va(_("Unknown argument - %s"), optarg);
+ usage5();
}
}
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 77df3c2e..e850337b 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -265,8 +265,8 @@ process_arguments (int argc, char **argv)
case 'a':
expected_address = optarg;
break;
- default: /* usage_va */
- usage_va(_("Unknown argument - %s"), optarg);
+ default: /* usage5 */
+ usage5();
}
}
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 93af7dc5..454f813b 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -370,7 +370,7 @@ process_arguments (int argc, char **argv)
critical = optarg;
break;
default: /* args not parsable */
- usage_va(_("Unknown argument - %s"), optarg);
+ usage5();
}
}
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 25ca4a8d..4dc48b77 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -258,7 +258,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_game.c b/plugins/check_game.c
index a785b511..79abec33 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -249,7 +249,7 @@ process_arguments (int argc, char **argv)
return ERROR;
break;
default: /* args not parsable */
- usage_va(_("Unknown argument - %s"), optarg);
+ usage5();
}
}
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 31a76bd2..8a60ce8c 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -351,7 +351,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_http.c b/plugins/check_http.c
index b81f2146..d1f3998b 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -225,7 +225,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* usage */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
break;
case 'h': /* help */
print_help ();
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index 14d27b33..234f23b7 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -212,7 +212,7 @@ main (int argc, char *argv[])
print_revision (progname, revision);
return STATE_OK;
default:
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 60872cfd..12ea0713 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -325,7 +325,7 @@ process_arguments (int argc, char **argv)
#endif
break;
default:
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 562eaf5d..3d00432f 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -236,7 +236,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 7cee31eb..4abe1d76 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -243,7 +243,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index adaf9e25..e587e5cd 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -277,7 +277,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index e10211fa..573ec96a 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -308,7 +308,7 @@ process_arguments (int argc, char **argv)
verbose++;
break;
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
index ecb7e7fe..bb62eecf 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -240,7 +240,7 @@ process_arguments (int argc, char **argv)
critical = optarg;
break;
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index a6ae71f2..5703e606 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -258,7 +258,7 @@ process_arguments (int argc, char **argv)
verbose++;
break;
default: /* print short usage_va statement if args not parsable */
- usage_va(_("Unknown argument - %s"), optarg);
+ usage5();
}
}
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 44203dbc..fe47a58b 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -492,7 +492,7 @@ int process_arguments(int argc, char **argv){
switch (c)
{
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help();
exit(STATE_OK);
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index d6e1dd5f..3ed8f347 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -694,7 +694,7 @@ int process_arguments(int argc, char **argv){
break;
case '?':
/* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
break;
}
}
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 91797dc8..53ac2e08 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -1355,7 +1355,7 @@ int process_arguments(int argc, char **argv) {
switch (c)
{
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help();
exit(STATE_OK);
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 2aca8ea5..25a7785a 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -341,7 +341,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 41c51413..cbff8d75 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -225,7 +225,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* usage */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index ca40920c..aa686a65 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -211,7 +211,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* usage */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index d9e2a671..da7e9f0f 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -359,7 +359,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index b1bb928f..4b340c3b 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -235,7 +235,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (OK);
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 2d24e148..0ccc1c09 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -368,7 +368,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* usage */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 94214ee0..94b97c4f 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -664,7 +664,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 1e1657b4..d9e00782 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -444,7 +444,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* usage */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 1c24e588..afe44c95 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -128,7 +128,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'V': /* version */
print_revision (progname, revision);
exit (STATE_OK);
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 59c1ecf6..1903a006 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -468,7 +468,7 @@ process_arguments (int argc, char **argv)
print_help ();
exit (STATE_OK);
case '?': /* error */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index faa3cedb..7e1bd38b 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -443,7 +443,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_time.c b/plugins/check_time.c
index ca420566..d3af3b0c 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -232,7 +232,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 280b3fb6..56438bb2 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -494,7 +494,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'H': /* hostname */
if (is_host (optarg)) {
server_address = optarg;
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 0c62e3b1..8e5f23d7 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -156,7 +156,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
case 'h': /* help */
print_help ();
exit (STATE_OK);
diff --git a/plugins/negate.c b/plugins/negate.c
index 45c03269..8b2dff0e 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -189,7 +189,7 @@ process_arguments (int argc, char **argv)
switch (c) {
case '?': /* help */
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
break;
case 'h': /* help */
print_help ();
diff --git a/plugins/urlize.c b/plugins/urlize.c
index 7793e9a8..612dd14d 100644
--- a/plugins/urlize.c
+++ b/plugins/urlize.c
@@ -100,7 +100,7 @@ main (int argc, char **argv)
break;
case '?':
default:
- usage2 (_("Unknown argument"), optarg);
+ usage5 ();
}
}
diff --git a/plugins/utils.c b/plugins/utils.c
index 2b3accea..7e1e58a2 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -94,6 +94,13 @@ usage4 (const char *msg)
exit (STATE_UNKNOWN);
}
+void
+usage5 (void)
+{
+ print_usage();
+ exit (STATE_UNKNOWN);
+}
+
char *
clean_revstring (const char *revstring)
{
diff --git a/plugins/utils.h b/plugins/utils.h
index 0d00ce85..f15a7b16 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -80,8 +80,9 @@ int max_state (int a, int b);
void usage (const char *) __attribute__((noreturn));
void usage2(const char *, const char *) __attribute__((noreturn));
void usage3(const char *, int) __attribute__((noreturn));
-void usage4(const char *);
-void usage_va(const char *fmt, ...);
+void usage4(const char *) __attribute__((noreturn));
+void usage5(void) __attribute__((noreturn));
+void usage_va(const char *fmt, ...) __attribute__((noreturn));
const char *state_text (int);