mon node ctrl: Warn and exit with error when we disregard all nodes

When 'mon node ctrl' is only passed nodenames which we're configured
not to connect to, we used to exit with a code indicating success.
Since that's not entirely accurate, and 'mon node ctrl' is used to
test commands on pollers, we really should do something better than
that. This patch makes it so that if only blocked nodes are given
we'll exit with return code 3 (conveniently, that's UNKNOWN to
Nagios) and print a message stating that we can't connect to that
node.

This sort of fixes issue #6452.

Signed-off-by: Andreas Ericsson <ae@op5.se>
import.c: Don't crash when importing downtimes

This bug was created by yours truly when attempting to port the hash
tables from the old, merlin-only API to the new, shared nagios API. With
the merlin ones, when there was a collision, the new entry would win.
With the nagios one, the opposite is true. This meant we would save the
wrong downtime entry when downtimes clashed - which they invariably do.

So, basically, I suck.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
import: Always remove entries from right table

Yeah, sooooo... Copy-paste error. I feel so proud.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
Revert "module: Simplify notification blocking logic"

This reverts commit f48f643b8014ba42cb0069ac48c2fc8eeac1e6d2.

It appears as though the fix introduced more problems than it
fixed, although more subtle ones (such as multiple recovery
notifications on dependency checks and possible multiple
downtime notifications), so we'll attempt a different fix for
this issue.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Fix multiple acknowledgement notifications, take two

With this patch we retain most of the old logic but introduce a
neat spot for handling network-command-received triggered events,
such as acknowledgement- and custom notifications.

Hopefully this will make it easier to fix future issues when
they crop up, while we're taking care of the current issue with
multiple acknowledgement notifications and avoiding multiple
recovery notifications.

Reported-by: Mark Frost <mark.frost1@pepsico.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
mon test: Add tests for expiring flexible downtime

This used to fail 14/20 until just recently, but as of merge
18f9bb6ac46896bfe767c36a3cea2aac42e1d124 to the nagios repo
it passes 20 out of 20.

Signed-off-by: Andreas Ericsson <ae@op5.se>
mon test: Add valgrind capabilities

It's nifty to be able to run daemons through valgrind when testing,
and this patch lets us do just that. There's still no commandline
support to enable it, but one will quite easily find the valgrind
code and hopefully the trigger to turn it on with some casual
source-code browsing.

Signed-off-by: Andreas Ericsson <ae@op5.se>