macros: Escape note macros as well

It seems that randomly blacklisting macros that a user manages to put a
doublequote into, instead of realizing that our whole approach is FUBAR
and that pretty much any macro can be used to break notification
commands, is the way to go. Jay :(

This resolves bug op5#8266.

Change-Id: I746b140947ca397059907518ea4d87c21ce138fe
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
test_macros: Escape {host,service}group note macros

This is pretty much identical to the patch in 83d1046dfb6 (which
fixes op5#8266) and as that commit implies, this is a nasty way of dealing
with the issue. There seems to be something fundamentally wrong with
the way macros work today, and we should probably spend some time
working out a better solution.

Anyway, I also added a test which should cover regressions of the service
part of op5#8266, which is the same issue as op5#8270, but for service and host
notes.

This fixes op5#8270.

Change-Id: Ic382c07b1aee988b01234bccdcd09e2d8d99a910
Signed-off-by: Anton Lofgren <alofgren@op5.com>
events: Remove "we're polling" from IPC log

It makes the IPC log become unusable. Put it in the scheduler log at
maximum verbosity - the scheduler log isn't used by anything anyway.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
base/workers: Consistensify

When the check output is empty, we try to print the stderr, even if the
stderr is empty, which results in confusing output - "(No output on
stdout) stderr:" (remember: nagios strips/chomps output) - which gives
the reader the impression that there's a stderr to read somewhere.

Instead, when there's not anything on stderr, set the output to NULL,
which is passed to process_check_result which is passed to
handle_async_host_check_result which is passed to parse_check_output
which results in check_output being set to NULL which
handle_async_host_check_result then replaces with "(No output returned
from host check)". Because layering.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
lib/worker: Log failure to register output handler

Nagios does, and it looks like it could be useful.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
build: Include buildopts in extra_dist

Otherwise, make dist won't include it.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
build: Put default paths in functions

This means
 a) Changing the paths won't break ABI. This makes it possible to write
    redistributable NEB modules, in the sense that they will actually be
    able to ask the naemon binary, rather than the headers on the system
    on where they were built, where default paths go.
 b) Tests can override them. Builds can pass again.

The headers are still there - because backward compatibility and stuff -
but the macro definitions should be put into defaults.c at some point.
There are also more macros that should get out of .h files, but that can
happen another day.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>