summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2004-03-03 12:33:15 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2004-03-03 12:33:15 (GMT)
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 77e2e27..bb38030 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}