Leading space in continuation lines

Gerhard Lausser Gerhard.Lausser at consol.de
Sat May 2 13:49:06 CEST 2009


Hi,

i have a servicedefinition which looks like that:

define service {
   service_description             os_linux_fs_check_ping
   host_name                       nagsrv
   use                             os_linux_default,pnp-preview-popup
   check_command                   \
       check_nrpe_arg!30!\
 
check_fs_ping!/mnt/account-p,/mnt/prepro-p,/mnt/webapp-ssl,/mnt/rollout-p
}

Now i found out that the leading blanks (the same applies for tabs) are
retained also in the macro $SERVICECHECKCOMMAND$. I write the checkresults
to a spoolfile with
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$....
\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\t....

where it comes out as:
....SERVICECHECKCOMMAND::check_nrpe_arg!30!       check_fs_ping....

If you postprocess these data, some tools might be confused by the white
space. (PNP for example, but it has a workaround for this in the upcoming
release)

I attached a patch for base/utils.c(mmap_fgets_multiline) (v3.10) which cuts
off leading white space from continuation lines. Whoever feels responsible
for the Nagios code, he might have a look at it. And maybe give a feedback?
Possibly by the end of this decade? Huhu, anybody at home?

Gerhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-3.1.0.stripspacefromcont.patch
Type: application/octet-stream
Size: 963 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090502/bffda199/attachment.obj>
-------------- next part --------------
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list