diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-03 12:33:15 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-03 12:33:15 +0000 |
commit | 7d7ca121bcabef8ba669c99388b23c1af0ca745e (patch) | |
tree | 4c12e32aebc02ad472120456fb053299791b3f93 /plugins/utils.c | |
parent | 3d87bf2c712e16e25956a2306383bd8a108344de (diff) | |
download | monitoring-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.c | 27 |
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; } |