diff options
author | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-01 23:54:51 +0000 |
---|---|---|
committer | Benoit Mortier <opensides@users.sourceforge.net> | 2004-12-01 23:54:51 +0000 |
commit | d19edd4043c498626fe68308005947975ef0a697 (patch) | |
tree | 7a213ee16f9331e928b1c32aa6c521c05519db58 /plugins/check_snmp.c | |
parent | 1d8128e328f714258b7fec0c62245e1d187e0439 (diff) | |
download | monitoring-plugins-d19edd4043c498626fe68308005947975ef0a697.tar.gz |
standardize localization string
standardize unknow arguments
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@969 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 11ea9559..7d0ebc92 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -14,6 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + $Id$ + ******************************************************************************/ const char *progname = "check_snmp"; @@ -118,9 +120,6 @@ char *miblist; - - - int main (int argc, char **argv) { @@ -158,7 +157,7 @@ main (int argc, char **argv) miblist = strdup (DEFAULT_MIBLIST); if (process_arguments (argc, argv) == ERROR) - usage (_("Incorrect arguments supplied\n")); + usage (_("check_snmp: could not parse arguments\n")); /* create the command line to execute */ asprintf (&command_line, "%s -t 1 -r %d -m %s -v %s %s %s:%s %s", @@ -344,9 +343,6 @@ main (int argc, char **argv) - - - /* process command-line arguments */ int process_arguments (int argc, char **argv) @@ -402,7 +398,9 @@ process_arguments (int argc, char **argv) switch (c) { case '?': /* usage */ - usage3 ("Unknown argument", optopt); + printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); + print_usage (); + exit (STATE_UNKNOWN); case 'h': /* help */ print_help (); exit (STATE_OK); @@ -601,8 +599,6 @@ process_arguments (int argc, char **argv) } - - /****************************************************************************** @@- @@ -623,6 +619,8 @@ first character cannot be a number, however.</para> -@@ ******************************************************************************/ + + int validate_arguments () { @@ -665,7 +663,6 @@ validate_arguments () asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd); } - } else { printf (_("Invalid SNMP version: %s\n"), proto); @@ -673,17 +670,11 @@ validate_arguments () exit (STATE_UNKNOWN); } - - - return OK; } - - - char * clarify_message (char *msg) { @@ -721,7 +712,6 @@ clarify_message (char *msg) - int check_num (int i) { @@ -766,7 +756,6 @@ check_num (int i) - int lu_getll (unsigned long *ll, char *str) { @@ -782,7 +771,6 @@ lu_getll (unsigned long *ll, char *str) - int lu_getul (unsigned long *ul, char *str) { @@ -798,7 +786,6 @@ lu_getul (unsigned long *ul, char *str) - /* trim leading whitespace if there is a leading quote, make sure it balances */ @@ -815,7 +802,6 @@ thisarg (char *str) - /* if there's a leading quote, advance to the trailing quote set the trailing quote to '\x0' if the string continues, advance beyond the comma */ @@ -851,9 +837,6 @@ nextarg (char *str) - - - void print_help (void) { @@ -960,6 +943,8 @@ Check status of remote machines and obtain sustem information via SNMP\n\n")); printf (_(UT_SUPPORT)); } + + void print_usage (void) { |