[Pkg-nagios-devel] Bug#498749: nagios-nrpe-server: Weird output of check_nrpe executed commands
Arne
arne at alamut.de
Sat Sep 13 00:12:10 UTC 2008
Package: nagios-nrpe-server
Version: 2.8.1-1.1
Tags: patch
X-Debbugs-Cc: arne at alamut.de
Using the check_nrpe command to a remote machine can result
to strange output of the remotely called command.
This occurs also in the syslog file, if syslogging is enabled
via nrpe.cfg. Usually one gets a some strange chars
after the output of a long output via check_load for example:
# /usr/lib/nagios/plugins/check_nrpe -n -H 192.168.2.6 -c check_load
OK - load average: 0.00, 0.02, 0.00|load1=0.000;15.000;30.000;0;
/load5=0.020;10.000;25.000;0; load15=0.000;5.000;20.000;0;
��ο1
This seems to me caused by the fact, that the buffer allocated
in nrpe.c is never nulled bevore used, using a memset to 0 fixes
the problem
--- src/nrpe.c.orig 2008-09-13 01:44:54.000000000 +0200
+++ src/nrpe.c 2008-09-13 01:44:09.000000000 +0200
@@ -1088,6 +1088,9 @@
/* disable connection alarm - a new alarm will be setup during
my_system */
alarm(0);
+
+ // null buffer befor using it!
+ memset(buffer,0,sizeof(buffer));
/* if this is the version check command, just spew it out */
if(!strcmp(command_name,NRPE_HELLO_COMMAND)){
-- System Information:
Debian Release: lenny
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
More information about the Pkg-nagios-devel
mailing list