aboutsummaryrefslogtreecommitdiff
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2004-03-03 12:33:15 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2004-03-03 12:33:15 +0000
commit7d7ca121bcabef8ba669c99388b23c1af0ca745e (patch)
tree4c12e32aebc02ad472120456fb053299791b3f93 /plugins/utils.c
parent3d87bf2c712e16e25956a2306383bd8a108344de (diff)
downloadmonitoring-plugins-7d7ca121bcabef8ba669c99388b23c1af0ca745e.tar.gz
begin writing some perfdata as float
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@841 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 77e2e279..bb380301 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -561,25 +561,30 @@ char *fperfdata (const char *label,
char *data = NULL;
if (strpbrk (label, "'= "))
- asprintf (&data, "'%s'=%ld%s;", label, val, uom);
+ asprintf (&data, "'%s'=", label);
else
- asprintf (&data, "%s=%ld%s;", label, val, uom);
+ asprintf (&data, "%s=", label);
+
+ asprintf (&data, "%s%f", data, val);
+ asprintf (&data, "%s%s;", data, uom);
if (warnp)
- asprintf (&data, "%s%ld;", data, warn);
- else
- asprintf (&data, "%s;", data);
+ asprintf (&data, "%s%f", data, warn);
+
+ asprintf (&data, "%s;", data);
if (critp)
- asprintf (&data, "%s%ld;", data, crit);
- else
- asprintf (&data, "%s;", data);
+ asprintf (&data, "%s%f", data, crit);
+
+ asprintf (&data, "%s;", data);
if (minp)
- asprintf (&data, "%s%ld", data, minv);
+ asprintf (&data, "%s%f", data, minv);
- if (maxp)
- asprintf (&data, "%s;%ld", data, maxv);
+ if (maxp) {
+ asprintf (&data, "%s;", data);
+ asprintf (&data, "%s%f", data, maxv);
+ }
return data;
}