commands: Don't lie when logging

Lying logs are not a lot better than none at all. This patch makes
Naemon log unknown service commands as unknown service commands, instead
of unknown host commands.

Signed-off-by: Anton Lofgren <anton.lofgren@gmail.com>
lib/rbtree.h: Add missing NAEMON_END_DECL

An unclosed 'extern "C" {' is a good way to screw up C++ builds
against C headers. This adds that missing end-of-declarations
thing so C++ knows that its own files are name-mangled.

Thus the build should work again.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/rbtree.c: Initialize num_nodes when creating trees

Without this patch, tests sometimes fail due to the value
being uninitialized but used when attempting to create hash
tables to store objects, which then can become ridiculously
large (like, with several billion entries), causing some
malloc() or other to fail horribly.

Signed-off-by: Andreas Ericsson <ae@op5.se>
commands: Add missing SEND_CUSTOM_SVC_NOTIFICATION

This patch adds in the implementation of SEND_CUSTOM_SVC_NOTIFICATION
which was accidentally removed in a previous overhaul of the command
code.

This fixes issue #65.

Reported-by: Johan Ryberg <johan@securit.se>
Signed-off-by: Anton Lofgren <anton.lofgren@gmail.com>
Merge pull request #67 from catharsis/issue-65

Issue 65
Make timeperiod timerange endings be non-inclusive

With timeperiods like this:
define timeperiod {
  timeperiod_name Test_exclude2
  alias           Test2 for exclude timeperiod
  tuesday 2 16:30-24:00
  exclude         myexclude2
}

define timeperiod{
  timeperiod_name myexclude2
  alias myexclude2
  tuesday 00:00-23:58
}

you would expect checks to start running at 23:58 and stop running
at midnight. Without this patch, however, checks would start at
23:59, which is counterintuitive. One could argue that timerange
endtimes should be inclusive, but then we wouldn't have the 24:00
syntax to mark the end of the day. Since we *do* have 24:00 to
mark end of the day, we must really consider both start and end
times to be in "HH:MM:00" notation, which is exactly what this
patch does.

Signed-off-by: Andreas Ericsson <ae@op5.se>
config: Kill all-but-deleted auto rescheduling

It didn't do anything, it just pretended it did. Stop pretending.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
t-tap config: Remove killed off variables

We don't want them around anymore, as they cause logfiles to
appear in the t-tap directory during "make distcheck", which
in turn causes the build to fail.

Signed-off-by: Andreas Ericsson <ae@op5.se>
shadownaemon: added more columns to cache

add some more columns to cached configuration.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
shadownaemon: read of size 0 mean eof

or at least an error, so break and do the error handling. This avoids
running in endless loops when the connection breaks right in the middle
of the transfer.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
shadownaemon: added missing comma

which breaks the livestatus query otherwise

Signed-off-by: Sven Nierlein <sven@nierlein.de>
commands: Add back missing commands

We accidentally lost the commands
CMD_SCHEDULE_HOSTGROUP_{HOST,SVC}_DOWNTIME when I gave this code a
facelift a while back. This patch adds them back. In theory, it should
be possible to statically ensure that all commands are implemented...

Also fixed a typo in an error message, comamnd -> command.

This fixes #71.

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Merge pull request #72 from catharsis/issue-71

Issue 71