Fix include-paths for Nagios headers

Since the changes to Nagios as of four seconds ago, the include
paths have changed slightly and we must follow suit.

Signed-off-by: Andreas Ericsson <ae@op5.se>
sql: Make database match Nagios 4 and livestatus a little better

Signed-off-by: Andreas Ericsson <ae@op5.se>
ocimp: Use Nagios 4 variable names when parsing cache files

Basically:
s/obsess_over_\(host|service\)\([^a-z]\)/obsess\2/

This is needed to make ocimp able to import Nagios 4 cache files
and status logs.

Reported-by: Mark Frost <mark.frost1@pepsico.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Add minimum_value and hourly_value to database tables

We don't really use them yet, but at least we can get them stored
in new installs now.

Signed-off-by: Andreas Ericsson <ae@op5.se>
ocimp: Use binary lookups when looking for keys

It's a few seconds faster on really large configs (although we're
already spending most of the time running queries, so it won't be a
huge impact). It does make it really easy for us to print the keys
in sorted order, which makes it easy to compare them against keys
obtained from Nagios' header files and see which ones we're missing.

Signed-off-by: Andreas Ericsson <ae@op5.se>
ocimp: Add Nagios 4 keys and some other missing keys

obsess_over_{host,service} becomes obsess, and we add hourly_value to
hosts and services and minimum_value and address[1-6] to contacts.

Signed-off-by: Andreas Ericsson <ae@op5.se>
mysql schema: Remove duplicate field for 'last_notification'

When we changed 'last_host_notification' to 'last_notification'
there was apparently already a 'last_notification' variable there,
so we got a duplicate.

Signed-off-by: Andreas Ericsson <ae@op5.se>
module: Remove slist lookups for seeing which checks we should do

Host and services have an 'id' field now, so we needn't bother
with artificially creating one by looking up the position of
objects in sorted lists.

This turns O(lg n) to O(1) for all "should we handle this" checks,
which is quite nifty.

Signed-off-by: Andreas Ericsson <ae@op5.se>
control.c: Remove declaration of scheduling_info

We don't need it.

Signed-off-by: Andreas Ericsson <ae@op5.se>
module: Create the host hash table with a more suitable size

Signed-off-by: Andreas Ericsson <ae@op5.se>
rename: Silence a compiler warning

At least on 64-bit systems, which really should be the only thing
we support "any day now".

Signed-off-by: Andreas Ericsson <ae@op5.se>
mysql schema: Re-add the {active,passive}_host_checks_enabled fields

They got lost somewhere, causing program status update queries to
fail.

Signed-off-by: Andreas Ericsson <ae@op5.se>
hookinfo: Put the most important fields first

This makes debugging a tad less unpleasant.

Signed-off-by: Andreas Ericsson <ae@op5.se>
codec: Print callback name when we fail to decode a packet

Looking up numerical codes is just a huge pain, so let's avoid it.

Signed-off-by: Andreas Ericsson <ae@op5.se>
ipc: Reduce I/O write delay

Having a write poll timeout of 0.1 second in the main thread can
kill performance outright in really large installations. If we
can't write immediately, we don't even try, but just cache it for
later writing and let Nagios' main thread get back to business.

Signed-off-by: Andreas Ericsson <ae@op5.se>
module: Send CTRL_ACTIVE from time to time

This gives peers and masters that have missed out on the fact that
we're up a chance to self-heal and start distributing load properly.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Merge branch 'nagios3'

* nagios3:
  module: Send CTRL_ACTIVE from time to time
  ipc: Reduce I/O write delay
sql/oracle: Spelling of comment_tbl_id_SEQ

Signed-off-by: Carl Helmertz <chelmertz@op5.com>
spec: Add build dep on nagios-devel

Without it, there will be no headers and the build will fail.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
sltest.c: Fix libnagios include file path

They were moved fairly recently, but this reference wasn't updated.

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