livestatus: new service column staleness: indicator outdated service checks
livestatus: staleness for hosts
code cleanup (eclipse tabs...)
livestatus: fixed error in staleness when nagios interval_length differed from 60
SEC Fixed various core SIGSEGV when using malformed livestatus queries

Some malformed livestatus queries could crash the monitoring core.
This happened whenever the value field for certain keys was missing.<br>

For example
C+:

lq "GET hosts\nColumnHeaders:\n"

lq "GET hosts\nAnd:\n"

lq "GET hosts\nKeepalive:\n

C-:
FIX TIMEPERIOD TRANSITION messages no longer cut at 64 bytes

Whenever the timeperiod name was specified very long not all information got
logged into the monitoring history during a timeperiod transition.<br>
For example:<br>
nagios-02-07-2014-00.log:[1391684695] TIMEPERIOD TRANSITION: ab@mathias-kettner.de_demo_timeperiod@shd-online.d<br><br>

Some mandatory information was missing at the end of the line, thus causing
the livestatus statehist table to crash, while processing such an invalid entry.
FIX livestatus log table: fixed missing logentries of archived logfiles

In archived logfiles the line numbering of the logfile entries was incorrect.
The incorrect number could collide with the configuration option max_lines_per_logfile,
thus leading to an error where archive logfiles where not read completely.<br>
For example:<br>
More than 1000000 lines in ….. /live/var/archives/nagios-01-20-2014-00.log. Ignoring the rest!
FIX Fix semantics of columns num_services_hard_*

In the tables <tt>hosts</tt> and <tt>servicegroups</tt> the columns
<tt>num_services_hard_warn</tt>, <tt>num_services_hard_crit</tt> and
<tt>num_services_hard_unknown<tt> did not correctly reflect the
hard status but in most cases just the soft status - effectively
ignoring the <tt>_hard_</tt>. This has now been fixed.
New header for limiting the execution time of a query

The new Livestatus header Timelimit: sets an upper limit
for the execution time of a query. Specify the timeout as
a number of seconds. The following query will stop after
5000 lines of output. If that takes longer than 30 seconds,
then the query <b>fails with no output</b>:

F+:query.lql
GET log
Columns: message
Timelimit: 30
Limit: 5000
F-:

Please note, that <tt>Limit:</tt> and <tt>Timelimit:</tt> have
a different behaviour when the limit is reached:

<li class=list><tt>Limit:</tt> end the query, output all rows that
have been found so far.</li>
<li class=list><tt>Timelimit:</tt> abort the query with an error,
do not output any lines.</li>
FIX Limit the number of lines read from a single logfile

If for some reason you have very large history logfiles with millions of
entries then Livestatus would consume large amounts of memory while parsing
these when you access the <tt>log</tt> table. This could lead to a hanging
system or even a crash.

In order to avoid such situations the number of lines that are read from each
individual file are now limited. The default limit is one million lines. You
can change this default by defining the variable <tt>max_lines_per_logfile/tt>
in your <tt>nagios.cfg</tt>. The following example sets the maximum number
to 20 million lines:

F+:
broker_module=/some/path/livestatus.o max_lines_per_logfile=20000000 ...
F-:

When using the Check_MK Micro Core the configuration can be done
via WATO global setting <i>Maximum number of parsed lines per log file</i>.
FIX Parse state of downtime notification log entries correctly

The state information of log messages of notifications that are
triggered by downtimes was not correctly parsed. This has been
fixed.
Removed "livecheck".

It never was really stable. Nagios4 has something similar built in. And also
the Check_MK Micro Core.
Livestatus: fix some compile problems on lenny
added missing header

strncmp is part of string.h

Signed-off-by: Sven Nierlein <sven@nierlein.de>