diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-01-13 12:15:16 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-01-13 12:15:16 (GMT) |
commit | 0c3386274ef5002dffc20337ef02407f24d7400c (patch) | |
tree | 1e78bac7844a548e56a642b35acfe1fd67342f71 /plugins/check_vsz.c | |
parent | de5650f28e4e43a7264913953f95a75d8afe23f0 (diff) | |
download | monitoring-plugins-0c3386274ef5002dffc20337ef02407f24d7400c.tar.gz |
convert PROGANE from a define to a const char
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@238 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_vsz.c')
-rw-r--r-- | plugins/check_vsz.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/check_vsz.c b/plugins/check_vsz.c index 7eeab22..767abf4 100644 --- a/plugins/check_vsz.c +++ b/plugins/check_vsz.c | |||
@@ -33,7 +33,7 @@ | |||
33 | * | 33 | * |
34 | *****************************************************************************/ | 34 | *****************************************************************************/ |
35 | 35 | ||
36 | #define PROGNAME "check_vsz" | 36 | const char *progname = "check_vsz"; |
37 | #define REVISION "$Revision$" | 37 | #define REVISION "$Revision$" |
38 | #define COPYRIGHT "1999-2002" | 38 | #define COPYRIGHT "1999-2002" |
39 | #define AUTHOR "Karl DeBisschop" | 39 | #define AUTHOR "Karl DeBisschop" |
@@ -45,8 +45,8 @@ | |||
45 | #include "utils.h" | 45 | #include "utils.h" |
46 | 46 | ||
47 | int process_arguments (int argc, char **argv); | 47 | int process_arguments (int argc, char **argv); |
48 | void print_help (char *cmd); | 48 | void print_help (const char *cmd); |
49 | void print_usage (char *cmd); | 49 | void print_usage (const char *cmd); |
50 | 50 | ||
51 | int warn = -1; | 51 | int warn = -1; |
52 | int crit = -1; | 52 | int crit = -1; |
@@ -64,8 +64,8 @@ main (int argc, char **argv) | |||
64 | char *message = ""; | 64 | char *message = ""; |
65 | 65 | ||
66 | if (!process_arguments (argc, argv)) { | 66 | if (!process_arguments (argc, argv)) { |
67 | printf ("%s: failure parsing arguments\n", my_basename (argv[0])); | 67 | printf ("%s: failure parsing arguments\n", progname); |
68 | print_help (my_basename (argv[0])); | 68 | print_help (progname); |
69 | return STATE_UNKNOWN; | 69 | return STATE_UNKNOWN; |
70 | } | 70 | } |
71 | 71 | ||
@@ -166,20 +166,20 @@ process_arguments (int argc, char **argv) | |||
166 | 166 | ||
167 | switch (c) { | 167 | switch (c) { |
168 | case '?': /* help */ | 168 | case '?': /* help */ |
169 | printf ("%s: Unknown argument: %s\n\n", my_basename (argv[0]), optarg); | 169 | printf ("%s: Unknown argument: %s\n\n", progname, optarg); |
170 | print_usage (my_basename (argv[0])); | 170 | print_usage (progname); |
171 | exit (STATE_UNKNOWN); | 171 | exit (STATE_UNKNOWN); |
172 | case 'h': /* help */ | 172 | case 'h': /* help */ |
173 | print_help (my_basename (argv[0])); | 173 | print_help (progname); |
174 | exit (STATE_OK); | 174 | exit (STATE_OK); |
175 | case 'V': /* version */ | 175 | case 'V': /* version */ |
176 | print_revision (my_basename (argv[0]), "$Revision$"); | 176 | print_revision (progname, "$Revision$"); |
177 | exit (STATE_OK); | 177 | exit (STATE_OK); |
178 | case 'c': /* critical threshold */ | 178 | case 'c': /* critical threshold */ |
179 | if (!is_intnonneg (optarg)) { | 179 | if (!is_intnonneg (optarg)) { |
180 | printf ("%s: critical threshold must be an integer: %s\n", | 180 | printf ("%s: critical threshold must be an integer: %s\n", |
181 | my_basename (argv[0]), optarg); | 181 | progname, optarg); |
182 | print_usage (my_basename (argv[0])); | 182 | print_usage (progname); |
183 | exit (STATE_UNKNOWN); | 183 | exit (STATE_UNKNOWN); |
184 | } | 184 | } |
185 | crit = atoi (optarg); | 185 | crit = atoi (optarg); |
@@ -187,8 +187,8 @@ process_arguments (int argc, char **argv) | |||
187 | case 'w': /* warning threshold */ | 187 | case 'w': /* warning threshold */ |
188 | if (!is_intnonneg (optarg)) { | 188 | if (!is_intnonneg (optarg)) { |
189 | printf ("%s: warning threshold must be an integer: %s\n", | 189 | printf ("%s: warning threshold must be an integer: %s\n", |
190 | my_basename (argv[0]), optarg); | 190 | progname, optarg); |
191 | print_usage (my_basename (argv[0])); | 191 | print_usage (progname); |
192 | exit (STATE_UNKNOWN); | 192 | exit (STATE_UNKNOWN); |
193 | } | 193 | } |
194 | warn = atoi (optarg); | 194 | warn = atoi (optarg); |
@@ -203,8 +203,8 @@ process_arguments (int argc, char **argv) | |||
203 | if (warn == -1) { | 203 | if (warn == -1) { |
204 | if (!is_intnonneg (argv[c])) { | 204 | if (!is_intnonneg (argv[c])) { |
205 | printf ("%s: critical threshold must be an integer: %s\n", | 205 | printf ("%s: critical threshold must be an integer: %s\n", |
206 | PROGNAME, argv[c]); | 206 | progname, argv[c]); |
207 | print_usage (PROGNAME); | 207 | print_usage (progname); |
208 | exit (STATE_UNKNOWN); | 208 | exit (STATE_UNKNOWN); |
209 | } | 209 | } |
210 | warn = atoi (argv[c++]); | 210 | warn = atoi (argv[c++]); |
@@ -213,8 +213,8 @@ process_arguments (int argc, char **argv) | |||
213 | if (crit == -1) { | 213 | if (crit == -1) { |
214 | if (!is_intnonneg (argv[c])) { | 214 | if (!is_intnonneg (argv[c])) { |
215 | printf ("%s: critical threshold must be an integer: %s\n", | 215 | printf ("%s: critical threshold must be an integer: %s\n", |
216 | PROGNAME, argv[c]); | 216 | progname, argv[c]); |
217 | print_usage (PROGNAME); | 217 | print_usage (progname); |
218 | exit (STATE_UNKNOWN); | 218 | exit (STATE_UNKNOWN); |
219 | } | 219 | } |
220 | crit = atoi (argv[c++]); | 220 | crit = atoi (argv[c++]); |
@@ -227,14 +227,14 @@ process_arguments (int argc, char **argv) | |||
227 | } | 227 | } |
228 | 228 | ||
229 | void | 229 | void |
230 | print_usage (char *cmd) | 230 | print_usage (const char *cmd) |
231 | { | 231 | { |
232 | printf ("Usage: %s -w <wsize> -c <csize> [-C command]\n" | 232 | printf ("Usage: %s -w <wsize> -c <csize> [-C command]\n" |
233 | " %s --help\n" " %s --version\n", cmd, cmd, cmd); | 233 | " %s --help\n" " %s --version\n", cmd, cmd, cmd); |
234 | } | 234 | } |
235 | 235 | ||
236 | void | 236 | void |
237 | print_help (char *cmd) | 237 | print_help (const char *cmd) |
238 | { | 238 | { |
239 | print_revision ("check_vsz", "$Revision$"); | 239 | print_revision ("check_vsz", "$Revision$"); |
240 | printf | 240 | printf |