[Nagios-devel] Solved - still a bug but a different one;

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] Solved - still a bug but a different one;

Post by Guest »

Hi!

On Fri, 29 Feb 2008, Joerg Linge wrote:
> > Apparently, this line:
> >
> > service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\t$TIMET$
>
> Works like a charm here with nagios 3.0rc3

I've found it after doing som rigorous debugging using
fopen/fprintf. I have to say that it's obscure and while Nagios
isn't at fault /per se/ (it does exactly what it's told to do),
it's a nast, nasty trap to fall into. It might be worthwhile to
consider fixing Nagios in this regard.

What happened was that I was playing around with different
settings for service_perfdata_file_template. In that process, I
ended up with this block of cfg file lines:

host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
# service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
# service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\
service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\t$TIMET$

Can you spot the problem? If you do, congratulations, it took you
about six hours less than me. The problem is in the second to
last line: it ends with a \ - thus, logically, the following line
gets appended to it. Since the line containing the \ is a
comment, the last line vanishes entirely.

It might be a good idea to *not* interpret a \ at the end of
comment lines.

Regards,
Tobias

--
"Have you any idea how successful censorship is on TV?
Don't know the answer? Hm. Successful, isn't it?" -Max Headroom





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