diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-08 06:00:51 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-02-08 06:00:51 +0000 |
commit | 00f86a8f6bfe204e6aa9eb2290ed9f3a8945cebe (patch) | |
tree | a6f87661d41b808d934228a81470b1b027d0fb85 /plugins | |
parent | 20cc276166823ca7b938e4b9aacf7fa2ffd25b73 (diff) | |
download | monitoring-plugins-00f86a8f6bfe204e6aa9eb2290ed9f3a8945cebe.tar.gz |
use enum instead of define
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@295 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_pgsql.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 613ff261..2d80fad1 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -44,7 +44,7 @@ const char *progname = "check_pgsql"; | |||
44 | -H, --hostname=STRING\n\ | 44 | -H, --hostname=STRING\n\ |
45 | Name or numeric IP address of machine running backend\n\ | 45 | Name or numeric IP address of machine running backend\n\ |
46 | -P, --port=INTEGER\n\ | 46 | -P, --port=INTEGER\n\ |
47 | Port running backend (default: %s)\n\ | 47 | Port running backend (default: %d)\n\ |
48 | -d, --database=STRING\n\ | 48 | -d, --database=STRING\n\ |
49 | Database to check (default: %s)\n\ | 49 | Database to check (default: %s)\n\ |
50 | -l, --logname = STRING\n\ | 50 | -l, --logname = STRING\n\ |
@@ -70,10 +70,12 @@ a password, but no effort is made to obsure or encrypt the password.\n" | |||
70 | 70 | ||
71 | #define DEFAULT_DB "template1" | 71 | #define DEFAULT_DB "template1" |
72 | #define DEFAULT_HOST "127.0.0.1" | 72 | #define DEFAULT_HOST "127.0.0.1" |
73 | #define DEFAULT_PORT "5432" | 73 | enum { |
74 | #define DEFAULT_WARN 2 | 74 | DEFAULT_PORT = 5432, |
75 | #define DEFAULT_CRIT 8 | 75 | DEFAULT_WARN = 2, |
76 | #define DEFAULT_TIMEOUT 30 | 76 | DEFAULT_CRIT = 8, |
77 | DEFAULT_TIMEOUT = 30 | ||
78 | }; | ||
77 | 79 | ||
78 | #include "config.h" | 80 | #include "config.h" |
79 | #include "common.h" | 81 | #include "common.h" |
@@ -90,7 +92,7 @@ int is_pg_logname (char *); | |||
90 | 92 | ||
91 | char *pghost = NULL; /* host name of the backend server */ | 93 | char *pghost = NULL; /* host name of the backend server */ |
92 | char *pgport = NULL; /* port of the backend server */ | 94 | char *pgport = NULL; /* port of the backend server */ |
93 | char default_port[4] = DEFAULT_PORT; | 95 | int default_port = DEFAULT_PORT; |
94 | char *pgoptions = NULL; | 96 | char *pgoptions = NULL; |
95 | char *pgtty = NULL; | 97 | char *pgtty = NULL; |
96 | char dbName[NAMEDATALEN] = DEFAULT_DB; | 98 | char dbName[NAMEDATALEN] = DEFAULT_DB; |