diff options
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r-- | plugins/check_pgsql.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 9bad1ec5..b8fc5f1d 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -34,6 +34,7 @@ const char *email = "devel@monitoring-plugins.org"; | |||
34 | 34 | ||
35 | #include "common.h" | 35 | #include "common.h" |
36 | #include "utils.h" | 36 | #include "utils.h" |
37 | #include "utils_cmd.h" | ||
37 | 38 | ||
38 | #include "netutils.h" | 39 | #include "netutils.h" |
39 | #include <libpq-fe.h> | 40 | #include <libpq-fe.h> |
@@ -302,10 +303,10 @@ process_arguments (int argc, char **argv) | |||
302 | usage5 (); | 303 | usage5 (); |
303 | case 'h': /* help */ | 304 | case 'h': /* help */ |
304 | print_help (); | 305 | print_help (); |
305 | exit (STATE_OK); | 306 | exit (STATE_UNKNOWN); |
306 | case 'V': /* version */ | 307 | case 'V': /* version */ |
307 | print_revision (progname, NP_VERSION); | 308 | print_revision (progname, NP_VERSION); |
308 | exit (STATE_OK); | 309 | exit (STATE_UNKNOWN); |
309 | case 't': /* timeout period */ | 310 | case 't': /* timeout period */ |
310 | if (!is_integer (optarg)) | 311 | if (!is_integer (optarg)) |
311 | usage2 (_("Timeout interval must be a positive integer"), optarg); | 312 | usage2 (_("Timeout interval must be a positive integer"), optarg); |
@@ -346,7 +347,7 @@ process_arguments (int argc, char **argv) | |||
346 | if (!is_pg_dbname (optarg)) /* checks length and valid chars */ | 347 | if (!is_pg_dbname (optarg)) /* checks length and valid chars */ |
347 | usage2 (_("Database name is not valid"), optarg); | 348 | usage2 (_("Database name is not valid"), optarg); |
348 | else /* we know length, and know optarg is terminated, so us strcpy */ | 349 | else /* we know length, and know optarg is terminated, so us strcpy */ |
349 | strcpy (dbName, optarg); | 350 | snprintf(dbName, NAMEDATALEN, "%s", optarg); |
350 | break; | 351 | break; |
351 | case 'l': /* login name */ | 352 | case 'l': /* login name */ |
352 | if (!is_pg_logname (optarg)) | 353 | if (!is_pg_logname (optarg)) |
@@ -565,7 +566,7 @@ print_help (void) | |||
565 | 566 | ||
566 | printf (" %s\n", _("Typically, the monitoring user (unless the --logname option is used) should be")); | 567 | printf (" %s\n", _("Typically, the monitoring user (unless the --logname option is used) should be")); |
567 | printf (" %s\n", _("able to connect to the database without a password. The plugin can also send")); | 568 | printf (" %s\n", _("able to connect to the database without a password. The plugin can also send")); |
568 | printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password.")); | 569 | printf (" %s\n", _("a password, but no effort is made to obscure or encrypt the password.")); |
569 | 570 | ||
570 | printf (UT_SUPPORT); | 571 | printf (UT_SUPPORT); |
571 | } | 572 | } |