Re: [Nagios-devel] Line continuations not working as expected

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

Re: [Nagios-devel] Line continuations not working as expected

Post by Guest »

Sorry folks, I thought I had checked this before sending the message, but
had done it wrong.

The issue is the difference between Unix & Windows line ends in the config
files.

Using a "\" to end a line terminated with Unix line end, Nagios correctly
treats the subsequent line as a continuation.

Unfortunately if a Windows line end (CRLF) follows the "\", Nagios does not
treat the line as a continuation.

Because of the way I use a Windows PC, almost all of my Nagios config files
have Windows not Unix line ends. Apart from this issue, I have had no
problems.

Would it be possible to adjust the code so as to allow continuations with
either type of line end?

Best wishes,
Matthew

------
>From: Matthew Richardson
>To: [email protected]
>Cc:
>Date: Mon, 31 Dec 2007 17:06:39 +0000
>Subject: [Nagios-devel] Line continuations not working as expected

>I have just tried the config:-
>
>|define host{
>| use template-host-generic,connectivity
>| host_name connectivity_test1
>| alias connectivity_test1
>| check_interval 1
>| check_command check_cluster_test1!\
>|$SERVICESTATEID:connectivity_test1:ping1$,\
>|$SERVICESTATEID:connectivity_test1:ping2$,\
>|$SERVICESTATEID:connectivity_test1:ping3$\
>|!1
>| address nohost.itconsult.net
>| }
>
>in order to assemble a very long check command in a readable way (the real
>one will be much longer than the test!).
>
>However it fails thus:-
>
>|Nagios 3.0rc1
>|Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
>|Last Modified: 12-17-2007
>|License: GPL
>|
>|Reading configuration data...
>|
>|Error: Invalid host object directive '$SERVICESTATEID:connectivity_test1:ping1$,\'.
>|Error: Could not add object property in file '/etc/nagios/connectivity/test1.cfg' on line 16.
>|
>|***> One or more problems was encountered while processing the config files...
>
>Am I doing something stupid, or is this a bug with the new line
>continuation feature?
>
>The config works fine with the command in one long line...
>
>Best wishes,
>Matthew
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2005.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Nagios-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/lis ... gios-devel






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