classic-ui: Drop statuswml.cgi #2654

refs: #2654

WAP interface, GONE!
classic-ui: Dropped statuswrl.cgi #2359

refs: #2359

3D status map, GONE!
classic-ui: Added action_url/notes_url to status.cgi for csvoutput and jsonoutput #2553

refs: #2553

adds action_url/notes_url to json and csv output
don't use system facilities for lsb header Should-start|stop

refs #2637
Merge branch 'master' into rbartels/next

Conflicts:
	Changelog
	cgi/status.c
	configure
core/classic ui: make hashfunc more efficient using sdbm #2761

currently, hashfunc runs in a loop adding up the characters.
this invokes a call to strlen on every run which is bad at once.
furthermore, the underlaying hash algorithm could cause collision
behaviour for similar keys.

               for (i = 0; i < strlen(name1); i++)
                       result += name1[i];

moving strlen before the loop helps a bit, but the hash algorithm needs
to be changed to be more effective once and for all.

the actual function is hash(i) = hash(i - 1) * 65599 + str[i]; which
leads to the magic constant of 65599 being a prime. berkely db and gawk
make use of that hash function as well.

http://www.cse.yorku.ca/~oz/hash.html

such enhancements will most likely only affect large scale systems with
a lot of similar keys, like one would generate with sni's
monitoring::testconfig module. either way, this should be adapted for
the core on comments/downtimes as well as statusdata, helping out the
classic ui scaling even better on reading the status data on each call.

props to Gunnar Beutner for finding and patching it.

refs #2761
core: try the most common macros ($ARGn$, $USERn$) first (Andreas Ericsson) #2674

the arg and user macros are most commonly used, as well as do not
require a copy of the original buffer, so this can be easily moved into
the first macro grabbing section, returning early once the macro has
been grabbed, increasing performance a bit.

kudos to Andreas Ericsson for the finding and patching.

refs #2674
core: unify check scheduling replacement logic for new events (Andreas Ericsson) #2676

previously, the logic on scheduling a new event was changed using the
new_event attribute. the decision for actually scheduling a new event
now happens generalized after having decided to actually do so.
furthermore next_check_event is correctly assigned to that new event for
the host|service check (which may be a bug in previous versions).

refs #2676
core: handle passive checks via external commands the same way as active checks, bypassing the temp check result file and reaper (Andreas Ericsson) #2687

basically, what happens now:

- passive check is sent via external command
- passive check handler stashes the newly allocated passive check results
  onto a doubly linked list
- once in a while, the passive check result list is being dumped onto disk
  into the temporary check results directory
- the check result reaper is being run, and reading those passive check
  results as well
- calling the check result handlers

the patch changes that to:

- passive check is sent via external command
- passive check is treated as "active" check result
  - set check_time to start and end
  - set exited_ok = 1
- pass the check result directly to check result handlers in memory

so it does not use the way around the core, being put into the check
results dir waiting for being reaped.
since this can be a huge performance improvement in regards of passing
passive check results to the core, it needs to be profiled, how much
impact it will be passing it directly to check handlers instead of
pushing to a list only.

plus, memory fragmention on the core will decrease by removing another
linked list from memory, as well as open file descriptors from the
temporary check result files on disk for the reaper.

requires extensive testing and profiling on performance issues.

refs #2687
fix compiler errors (refs #2761)
core: get rid of the instame macro usage while logging alerts and states (Andreas Ericsson) #2665

previously, each alert or state being logged caused all host and service
macros being grabbed (including memory allocation for those), and
logging the final processed buffer. as we can use some smaller switch
case function helpers to generated the same output for the already known
attributes on those hosts and services, we just remove that insame cpu
burning 'feature'.

refs #2665
icinga.spec: add devel package #2634

refs #2634
core: use binary search when looking up macro names, instead of insane strcmp() loops (Andreas Ericsson) #2675

without the patch, it currently happens like this

on each macro grabbing, a strcmp() happens to see which macro name this
is on each macro grabbing, the cleaning options are determined
strcmp()'s are pretty expensive, especially as macros are called that
frequently (like HOSTADDRESS).

the patch adds 2 things

- shortcuts for the most common used macros (HOSTADDRESS and HOSTADDRESS6)
  which can be strcmp()'ed and returned early, without any special
  cleaning options
- a precomputed array, sorted by macro name, on macro initialization,
  which is then gone through with binary comparison on the actual
  strcmp()'s

sorting the array alphabethical allows to compare it by value, as
strcmp() would then output. you'll check wether it's greater or less
than the mid value of the array. depending on the returned value of
strcmp() you'll either return the key (0), or step down into the logical
half, left or right. such a seek is pretty much more efficient than a
hash table, as the macro names are rather long in direct comparison with
a unique hash id being calculated.

since the previous version ran within a loop through all available
macros (MACRO_X_COUNT = 154) calling strcmp() which results in an O(n)
complexity for each xmacro, it can be reduced to O(log(n)) complexity by
using the precomputed sorted array with the binary search lookups with
strcmp()

requires further tests and profiling though.

refs #2675
core: revamp the detection of embedded perl usage directive "# icinga: +epn" (Andreas Ericsson) #2197

patch is revamping the detection of the first 10 lines containing the
"#icinga: +epn" line.

previously, the core would have read only the first 80 characters from
each line via fgets, which could be to less. the inner handling is
changed to 256 chars, which should be sufficient. removing the strtok on
':' is also a good idea, as this can be done via the strstr pointer
match on 'epn' as well, calculating the return value based on the
character ('+' means embedded perl enabled).

refs #2197
idoutils: change hasfunc to use sdbm algorithm for hashing precached objects #2792

this will probably speedup the calculation of the precached objects

refs #2792
core: add useful message to p1.pl when epn plugin does not call exit() (Sven Nierlein) #2431

refs #2431
sched_down.pl: fixed exit from procedure
contrib/log_hist.pl: examine object history based on log files
classic-ui: Added pagination to various cgi's #2725 - RB

refs: #2725

Added to:
* status.cgi for host & service status
* config.cgi
* extinfo.cgi for scheduling queue, comments and downtimes
* history.cgi
* notifications.cgi
* showlog.cgi

Added generic functions "page_num_selector" and "page_limit_selector" to cgiutils.c
Also added individual "status_page_num_selector" due to the special display case of STYLE_HOST_SERVICE_DETAIL

Added new config option "result_limit".
Removed config option "default_num_displayed_log_entries" !!!

Added URL GET options "limit" and "start" to cgi's using pagination.

Icon Source: http://www.iconfinder.com/search/?q=resultset by Mark James
Ideas and some code sourced from: Nagios, Thruk and Icinga-Web

This took way to long to implement but I hope this eases a lot of pain people having with long listings!

Don't forget: Stop talking, Start coding!
Merge branch 'rbartels/cgi' into dev/cgis