summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
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,
561 char *data = NULL; 561 char *data = NULL;
562 562
563 if (strpbrk (label, "'= ")) 563 if (strpbrk (label, "'= "))
564 asprintf (&data, "'%s'=%ld%s;", label, val, uom); 564 asprintf (&data, "'%s'=", label);
565 else 565 else
566 asprintf (&data, "%s=%ld%s;", label, val, uom); 566 asprintf (&data, "%s=", label);
567
568 asprintf (&data, "%s%f", data, val);
569 asprintf (&data, "%s%s;", data, uom);
567 570
568 if (warnp) 571 if (warnp)
569 asprintf (&data, "%s%ld;", data, warn); 572 asprintf (&data, "%s%f", data, warn);
570 else 573
571 asprintf (&data, "%s;", data); 574 asprintf (&data, "%s;", data);
572 575
573 if (critp) 576 if (critp)
574 asprintf (&data, "%s%ld;", data, crit); 577 asprintf (&data, "%s%f", data, crit);
575 else 578
576 asprintf (&data, "%s;", data); 579 asprintf (&data, "%s;", data);
577 580
578 if (minp) 581 if (minp)
579 asprintf (&data, "%s%ld", data, minv); 582 asprintf (&data, "%s%f", data, minv);
580 583
581 if (maxp) 584 if (maxp) {
582 asprintf (&data, "%s;%ld", data, maxv); 585 asprintf (&data, "%s;", data);
586 asprintf (&data, "%s%f", data, maxv);
587 }
583 588
584 return data; 589 return data;
585} 590}