[Nagios-devel] Patch: Multiline perfdata lacks trailing blanks

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Patch: Multiline perfdata lacks trailing blanks

Post by Guest »

This is a multi-part message in MIME format.
--------------040106050805090302070400
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


Hi Ethan, hi list,

for a new 3.x plugin I use the feature to specify multiple lines of
performance data as described in
http://nagios.sourceforge.net/docs/3_0/pluginapi.html

Example:http://www.my-plugin.de/wiki/doku.php/c ... ended_info

There is a small bug in utils.c which misses to add trailing blanks while
sticking them together into $SERVICEPERFDATA$.

I attached a small patch to add these blanks.

Kind regards,
Matthias


--------------040106050805090302070400
Content-Type: text/plain;
name="patch-utils.c-perfdata-with-trailing-blank"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="patch-utils.c-perfdata-with-trailing-blank"

--- nagios-3.01b/base/utils.c 2007-08-16 15:45:10.000000000 +0200
+++ nagios-3.01b-utils.c-perfdata-with-trailing-blank/base/utils.c 2007-08-18 08:22:51.000000000 +0200
@@ -4838,8 +4838,10 @@
else{

/* rest of the output is perf data */
- if(in_perf_data==TRUE)
+ if(in_perf_data==TRUE) {
dbuf_strcat(&db2,tempbuf);
+ dbuf_strcat(&db2," ");
+ }

/* we're still in long output */
else{
@@ -4856,8 +4858,10 @@
dbuf_strcat(&db1,ptr);

/* get the perf data */
- if((ptr=my_strtok(NULL,"\n")))
+ if((ptr=my_strtok(NULL,"\n"))) {
dbuf_strcat(&db2,ptr);
+ dbuf_strcat(&db2," ");
+ }
}

/* set the perf data flag */

--------------040106050805090302070400--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked