daemon: Check node activity for peers and masters too

I'm not sure if I should feel proud or disgusted that this bug went
unnoticed for so long. Proud because it means the merlin daemon is
*very* robust and doesn't crash at all, basically, and disgusted
because it was so obvious.

Signed-off-by: Andreas Ericsson <ae@op5.se>
daemon: Make the data timeout configurable per node

The default is still pulse_interval * 2, which is sensible for all
but the most shaky networks, but now one can configure it to be 0 for
the very slow links so they never timeout (well, until tcp times out,
anyways) and set lower timeouts for closer peered systems.

Signed-off-by: Andreas Ericsson <ae@op5.se>
daemon: Timeout systems that never send any data at all

The clumsy netcat test I did of the last patch uncovered this harmless
buglet. Since it's an easy fix and even reduces runtime cpu overhead,
we implement it promptly.

Signed-off-by: Andreas Ericsson <ae@op5.se>
HOWTO: Document the 'data_timeout' option

Also list the problem which caused its introduction and the fix
done in 7f2fc8f9850735ab549d3bbfa987b09af4cc1a6d.

Signed-off-by: Andreas Ericsson <ae@op5.se>
daemon: Check for data timeout even if we found data from some nodes

We'll still want to take over the checks for the nodes that didn't
send anything if it was a suspiciously long time since they sent
any data through the socket.

Signed-off-by: Andreas Ericsson <ae@op5.se>
conf.ramdisk.sh: Configure your system to use RAMDISK for temporary results

Configure your system to use ramdisk for temporary results like
checkresults and performance results for pnp.

will lower your I/O on loades servers with ALOT.

Signed-off-by: Mattias Ryrlén <mattiasr@op5.com>
mon log push: Create the state directory if it doesn't already

Otherwise pushing logs will always end up generating an error message
about us being unable to create the state directory.

This fixes issue #4935.

Signed-off-by: Andreas Ericsson <ae@op5.se>
modules/nagios_command: Always send commands to Nagios as upper-case

Nagios doesn't grok lower-case commands, so we'd better ship them as
uppercase.

Signed-off-by: Andreas Ericsson <ae@op5.se>
nrpe commands: Tweak to work with default settings and large installs

The previous thresholds were too scrawny for large installs to fit
inside them, while the new ones should capture any real problems in
the programs (such as galloping malloc() or cpu hogging from a loop).

We also make sure we can run nrpe with the default user of "nobody"
(by using asmonitor with 'mon check') and fix some syntax errors in
the check_procs commands that check cpu consumption of various
programs.

This fixes issue #5192.

Signed-off-by: Andreas Ericsson <ae@op5.se>
app module merlin_conf: Prettify error when config parsing fails

Previously we used to fall through to an unhandled exception,
which wasn't very pretty. This patch adds some very basic
exception handling which causes us to bomb out with as pretty an
error message as I'm inclined to give.

This fixes issue #4166.

Signed-off-by: Andreas Ericsson <ae@op5.se>
nrpe-merlin: Remove asmonitor

It prints a lot of extra output which doesn't sit well with nrpe
and the plugin it's about to execute.

This means we'll have to keep running nrpe as monitor in most
environments, but since that's already implemented in the spec
file no further changes are required to get the merlin checks to
work properly.

Signed-off-by: Andreas Ericsson <ae@op5.se>
apps/mon.py: Don't stacktrace when finding invalid file in libexec dir

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
conf.ramdisk.sh: added check if misccommands.cfg exist

on a poller system misccommands.cfg doesn't exists so we can't alter that
file, the changes comes from the oconf/from-master.cfg and are hopefully
already corrected.

Signed-off-by: Mattias Ryrlén <mattiasr@op5.com>
mon test: Use system livestatus by default

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
test: Fix write statement

Was only visible when running without a tty.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
mon test: Fix intermission outputs for non-tty runs

The output was messed up.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
Makefile: Re-arrange link arguments

Apparently, putting "$^ -o $@" last makes some linkers whine,
although possibly only when libdbi is in a nonstandard location,
or when there are additional LDFLAGS given by the user.

This patch fixes it, which should make all distros (even Ubuntu)
capable of compiling Merlin just fine.

Reported-by: Antti Mäkelä <Antti.Makela@vintor.fi>
Signed-off-by: Andreas Ericsson <ae@op5.se>
sql/oracle: Don't drop tables supposed to be persistent

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
sql/oracle: Try to upgrade tables from 5.4 schema

...in a very, very hacky way :/

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
kad.conf: Remove redundant and/or invalid config options

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