diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-14 04:09:19 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-14 04:09:19 (GMT) |
commit | 4e318b9277ba5209fab447da5afa3c0a22a681d9 (patch) | |
tree | 65e99d3a8181584d75726390c5968270c21afa63 /plugins/check_pgsql.c | |
parent | b86b521b38a993b49e03f827859aea672fdfa806 (diff) | |
download | monitoring-plugins-4e318b9277ba5209fab447da5afa3c0a22a681d9.tar.gz |
use fperfdata
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@849 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r-- | plugins/check_pgsql.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 00b051b..22a5b81 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -45,8 +45,8 @@ char *pgtty = NULL; | |||
45 | char dbName[NAMEDATALEN] = DEFAULT_DB; | 45 | char dbName[NAMEDATALEN] = DEFAULT_DB; |
46 | char *pguser = NULL; | 46 | char *pguser = NULL; |
47 | char *pgpasswd = NULL; | 47 | char *pgpasswd = NULL; |
48 | int twarn = DEFAULT_WARN; | 48 | double twarn = (double)DEFAULT_WARN; |
49 | int tcrit = DEFAULT_CRIT; | 49 | double tcrit = (double)DEFAULT_CRIT; |
50 | 50 | ||
51 | PGconn *conn; | 51 | PGconn *conn; |
52 | /*PGresult *res;*/ | 52 | /*PGresult *res;*/ |
@@ -168,8 +168,8 @@ main (int argc, char **argv) | |||
168 | PQfinish (conn); | 168 | PQfinish (conn); |
169 | printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"), | 169 | printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"), |
170 | state_text(status), dbName, elapsed_time, | 170 | state_text(status), dbName, elapsed_time, |
171 | perfdata("time", (long)elapsed_time, "s", | 171 | fperfdata("time", elapsed_time, "s", |
172 | twarn, (long)twarn, tcrit, (long)tcrit, TRUE, 0, FALSE,0)); | 172 | (int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0)); |
173 | return status; | 173 | return status; |
174 | } | 174 | } |
175 | 175 | ||
@@ -221,16 +221,16 @@ process_arguments (int argc, char **argv) | |||
221 | timeout_interval = atoi (optarg); | 221 | timeout_interval = atoi (optarg); |
222 | break; | 222 | break; |
223 | case 'c': /* critical time threshold */ | 223 | case 'c': /* critical time threshold */ |
224 | if (!is_integer (optarg)) | 224 | if (!is_nonnegative (optarg)) |
225 | usage2 (_("Invalid critical threshold"), optarg); | 225 | usage2 (_("Invalid critical threshold"), optarg); |
226 | else | 226 | else |
227 | tcrit = atoi (optarg); | 227 | tcrit = strtod (optarg, NULL); |
228 | break; | 228 | break; |
229 | case 'w': /* warning time threshold */ | 229 | case 'w': /* warning time threshold */ |
230 | if (!is_integer (optarg)) | 230 | if (!is_nonnegative (optarg)) |
231 | usage2 (_("Invalid critical threshold"), optarg); | 231 | usage2 (_("Invalid critical threshold"), optarg); |
232 | else | 232 | else |
233 | twarn = atoi (optarg); | 233 | twarn = strtod (optarg, NULL); |
234 | break; | 234 | break; |
235 | case 'H': /* host */ | 235 | case 'H': /* host */ |
236 | if (!is_host (optarg)) | 236 | if (!is_host (optarg)) |