aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_pgsql.c
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2004-03-14 04:09:19 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2004-03-14 04:09:19 +0000
commit4e318b9277ba5209fab447da5afa3c0a22a681d9 (patch)
tree65e99d3a8181584d75726390c5968270c21afa63 /plugins/check_pgsql.c
parentb86b521b38a993b49e03f827859aea672fdfa806 (diff)
downloadmonitoring-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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 00b051be..22a5b811 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -45,8 +45,8 @@ char *pgtty = NULL;
char dbName[NAMEDATALEN] = DEFAULT_DB;
char *pguser = NULL;
char *pgpasswd = NULL;
-int twarn = DEFAULT_WARN;
-int tcrit = DEFAULT_CRIT;
+double twarn = (double)DEFAULT_WARN;
+double tcrit = (double)DEFAULT_CRIT;
PGconn *conn;
/*PGresult *res;*/
@@ -168,8 +168,8 @@ main (int argc, char **argv)
PQfinish (conn);
printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"),
state_text(status), dbName, elapsed_time,
- perfdata("time", (long)elapsed_time, "s",
- twarn, (long)twarn, tcrit, (long)tcrit, TRUE, 0, FALSE,0));
+ fperfdata("time", elapsed_time, "s",
+ (int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0));
return status;
}
@@ -221,16 +221,16 @@ process_arguments (int argc, char **argv)
timeout_interval = atoi (optarg);
break;
case 'c': /* critical time threshold */
- if (!is_integer (optarg))
+ if (!is_nonnegative (optarg))
usage2 (_("Invalid critical threshold"), optarg);
else
- tcrit = atoi (optarg);
+ tcrit = strtod (optarg, NULL);
break;
case 'w': /* warning time threshold */
- if (!is_integer (optarg))
+ if (!is_nonnegative (optarg))
usage2 (_("Invalid critical threshold"), optarg);
else
- twarn = atoi (optarg);
+ twarn = strtod (optarg, NULL);
break;
case 'H': /* host */
if (!is_host (optarg))