summaryrefslogtreecommitdiffstats
path: root/plugins/check_pgsql.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2004-03-14 04:09:19 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2004-03-14 04:09:19 (GMT)
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 00b051b..22a5b81 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -45,8 +45,8 @@ char *pgtty = NULL;
45char dbName[NAMEDATALEN] = DEFAULT_DB; 45char dbName[NAMEDATALEN] = DEFAULT_DB;
46char *pguser = NULL; 46char *pguser = NULL;
47char *pgpasswd = NULL; 47char *pgpasswd = NULL;
48int twarn = DEFAULT_WARN; 48double twarn = (double)DEFAULT_WARN;
49int tcrit = DEFAULT_CRIT; 49double tcrit = (double)DEFAULT_CRIT;
50 50
51PGconn *conn; 51PGconn *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))