Changing the values in header files

3 replies [Last post]
Pennylane's picture
Joined: 27.07.2011

Hello and thanks for the great tool. I want to change some variables that are defined in header files. Like:

in common.h

#define MAX_INPUT_BUFFER            1024    /* size in bytes of max. input buffer (for reading files, misc stuff) */

in nagios.h
#define MAX_PLUGIN_OUTPUT_LENGTH                8192    /* max length of plugin output (including perf data) */

Because I am getting an error that says "UNKNOWN: Return buffer to small to handle this command. "

I googled and found some posts that suggest to change the values in the header files. How can I change them? Should I need to recompile nagios and change the created exes with the exes of nagwin?

Thanks in advance.

itefix's picture
Joined: 01.05.2008
 A recompile is needed to

 A recompile is needed to achieve what you want. Have a look at a related forum topic for further instructions.

Joined: 27.07.2011
Thanks for your reply. I just

Thanks for your reply. I just had time to compile the nagios. Unfortunately I am not an expert of compiling sources on different systems. I tried to compile it today in Cygwin and I am getting errors because of paths.

 I managed to run the configure script with the command:

./configure CC=gcc --prefix="$(cygpath -aw "$SYSTEMDRIVE/nagios")" \

--bindir="$(cygpath -pw "\${exec_prefix}/bin")" \

--sbindir="$(cygpath -pw "\${exec_prefix}/sbin")" \

--libexecdir="$(cygpath -pw "\${exec_prefix}/libexec")" \

--datadir="$(cygpath -pw "\${prefix}/share")" \

--sysconfdir="$(cygpath -pw "\${prefix}/etc")" \

--sharedstatedir="$(cygpath -pw "\${prefix}/com")" \

--localstatedir="$(cygpath -pw "\${prefix}/var")" 

So in the end I will have my directories which are in Windows path structure. But when I run the make all command it gives an error, because the paths in file are still in linux format. As in the example below:

#define DEFAULT_TEMP_FILE  "@localstatedir@/tempfile"

#define DEFAULT_TEMP_PATH   "/tmp"

#define DEFAULT_CHECK_RESULT_PATH "@localstatedir@/spool/checkresults"

#define DEFAULT_STATUS_FILE  "@localstatedir@/status.dat"

#define DEFAULT_LOG_FILE  "@localstatedir@/nagios.log"


I wanted you ask if this is the correct way I am following? Because for the next step I will manually change the values in file.

Thanks a lot for your help.



Joined: 01.05.2008
 You need to use Linux-like

 You need to use Linux-like paths. You may actually consider to go for Nagios on Linux for thst kind of adjustments.