From 7d7ca121bcabef8ba669c99388b23c1af0ca745e Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Wed, 3 Mar 2004 12:33:15 +0000 Subject: begin writing some perfdata as float git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@841 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/utils.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'plugins/utils.c') 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; } -- cgit v1.2.3