Little change-request for do_temperature.c ...

Rolf Masfelder rolf.masfelder at nector.de
Thu Dec 27 09:18:58 CET 2007


Hallo Henrik,

the last Days were a litle bit cold in germany. So i found that 
rrd/do_temperature.c dont work correctly on negative values ...

In the part:

			p = bol + strlen(bol) - 1;
			while ((p > bol) && isspace((int)*p)) p--;
			while ((p > bol) && isdigit((int)*p)) p--;
			tmpF = atoi(p);
			while ((p > bol) && isspace((int)*p)) p--;
			while ((p > bol) && isdigit((int)*p)) p--;
			tmpC = atoi(p);

there have be two additional lines of code:

			p = bol + strlen(bol) - 1;
			while ((p > bol) && isspace((int)*p)) p--;
			while ((p > bol) && isdigit((int)*p)) p--;
-->			while ((p > bol) && *p == '-') p--;
			tmpF = atoi(p);
			while ((p > bol) && isspace((int)*p)) p--;
			while ((p > bol) && isdigit((int)*p)) p--;
-->			while ((p > bol) && *p == '-') p--;
			tmpC = atoi(p);

The rrd-File has to bee build with another Minimum for the Values 
stored. I dont find the code for the creation, but 
"rrdtool tune temperature.sensor4.rrd -i temperature:-10" did the job 
for my environment.
 
please insert the lines of code into do_temperature.c 

greetings

to All: (after christmas) I wish you a happy new year

Rolf



More information about the Xymon mailing list