diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 98c504faff1d7f1147514d2afde2a7ffc1f4944f..2d80fad1bb04560c89fafc1dcd1c639ad942bcc0 100644 (file)
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
*
*****************************************************************************/
-#define PROGNAME "check_pgsql"
+const char *progname = "check_pgsql";
#define REVISION "$Revision$"
#define COPYRIGHT "1999-2001"
#define AUTHOR "Karl DeBisschop"
-H, --hostname=STRING\n\
Name or numeric IP address of machine running backend\n\
-P, --port=INTEGER\n\
- Port running backend (default: %s)\n\
+ Port running backend (default: %d)\n\
-d, --database=STRING\n\
Database to check (default: %s)\n\
-l, --logname = STRING\n\
#define DEFAULT_DB "template1"
#define DEFAULT_HOST "127.0.0.1"
-#define DEFAULT_PORT "5432"
-#define DEFAULT_WARN 2
-#define DEFAULT_CRIT 8
-#define DEFAULT_TIMEOUT 30
+enum {
+ DEFAULT_PORT = 5432,
+ DEFAULT_WARN = 2,
+ DEFAULT_CRIT = 8,
+ DEFAULT_TIMEOUT = 30
+};
#include "config.h"
#include "common.h"
char *pghost = NULL; /* host name of the backend server */
char *pgport = NULL; /* port of the backend server */
-char default_port[4] = DEFAULT_PORT;
+int default_port = DEFAULT_PORT;
char *pgoptions = NULL;
char *pgtty = NULL;
char dbName[NAMEDATALEN] = DEFAULT_DB;
<manvolnum>5<manvolnum>
</refmeta>
<refnamdiv>
-<refname>&PROGNAME;</refname>
+<refname>&progname;</refname>
<refpurpose>&SUMMARY;</refpurpose>
</refnamdiv>
</refentry>
void
print_help (void)
{
- print_revision (PROGNAME, REVISION);
+ print_revision (progname, REVISION);
printf
("Copyright (c) %s %s <%s>\n\n%s\n",
COPYRIGHT, AUTHOR, EMAIL, SUMMARY);
printf ("Usage:\n" " %s %s\n"
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
- PROGNAME, OPTIONS, PROGNAME, PROGNAME);
+ progname, OPTIONS, progname, progname);
}
\f
print_help ();
exit (STATE_OK);
case 'V': /* version */
- print_revision (PROGNAME, REVISION);
+ print_revision (progname, REVISION);
exit (STATE_OK);
case 't': /* timeout period */
if (!is_integer (optarg))