docs: Flesh out the config changes page a bit

There are config management tools aplenty, and this way their authors
can get all the information they need to make it work on Nagios 4 as
well as it did on Nagios 3.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2655 5f96b256-904b-4d8d-8c98-d829582c6739
Makefile: Add 'test' to '.PHONY'

Otherwise tests won't run now that we have a directory named
'test' as well.

While at it, make sure the 'test' target runs the libnagios tests.
Not very much will work if libnagios is broken, so we do those
first.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2656 5f96b256-904b-4d8d-8c98-d829582c6739
lib: .gitignore test-runcmd

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2657 5f96b256-904b-4d8d-8c98-d829582c6739
core: Stop leaking the string to default logfile

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2658 5f96b256-904b-4d8d-8c98-d829582c6739
xodtemplate: Fix same-host service dependencies with inexact master

Weird subject, but here's the thing. In Nagios 3 we supported
same-host servicedependencies where the host was defined by having
exact settings for the dependent services (such as a servicegroup
or a combination of dependent_hostgroup_name/dependent_host_name
AND dependent_service_description). With Nagios 4-ish, that test
slipped through the testing net, even though we actually have a
test configuration just like that checked in alongside the code.

With this patch, we no longer bomb out when given servicedependencies
such as this:
  define servicedependency {
     service_description           some-service
     dependent_servicegroup        some-service-group
     notification_failure_criteria w,c
  }

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2659 5f96b256-904b-4d8d-8c98-d829582c6739
common/objects: Make qsort() comparison functions a lot faster

Since host and service objects are sorted lexicographically and
carry an unsigned int as id, which is incremental based on the
sort order, we can just compare integers rather than run full
string comparisons when sorting host and service dependencies.

I'm unsure how much impact this has on config reload times, but
it will surely make it slightly faster. The fact that we remove
more code than we add makes that a double win.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2660 5f96b256-904b-4d8d-8c98-d829582c6739
common/objects: post-process dependencies for cgi's too

They don't need the sorting phase though, as objects are always
sorted when we print them to the object cache.

This should prevent the cgi's from dumping core when trying to
handle host or servicedependencies.

Reported-by: Mark Frost <mark.frost1@pepsico.com>
Reported-by: Jeff <iamirix@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2661 5f96b256-904b-4d8d-8c98-d829582c6739
core: Sort escalations in post_process_object_config()

We used to do that in Nagios 3, so doing it now too means a bunch
of tests will pass by default, and everything that handles Nagios'
internal data and expects it to be sorted will keep on working
mostly the same way it always has.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2662 5f96b256-904b-4d8d-8c98-d829582c6739
test: Update objects.precache.expected

This makes t/900-configtest.t work as intended again. Now that the
last code discrepancies between Nagios 3 and Nagios 4 have been
ironed out, we may as well update the tests to reflect the real
world.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2663 5f96b256-904b-4d8d-8c98-d829582c6739
Bump version to 3.99.96

Should be fairly ok now, I hope.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2664 5f96b256-904b-4d8d-8c98-d829582c6739
Fixed bug #432: Downtime scheduled as "Nagios Process" and not the Users name 

Previously the comment associated with a scheduled downtime would use a 
hard-coded value of "(Nagios Process)" as the user that scheduled the 
downtime. Now it will use the author from the downtime itself in the comment
associated with the downtime.

If no downtime author is specified (or more accurately, the author field in the
downtime structure is NULL), the system will default to "(Nagios Process)"
as the author of the downtime.


git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2667 5f96b256-904b-4d8d-8c98-d829582c6739
Corrected comparison operator in service freshness check logic.

The service freshness check logic was resetting the expiration after every
short (relative to the freshness threshold) Nagios outage for service 
checks but preserving the expiration if Nagios had been down for a long 
time in comparison with the freshness threshold.

This logic was opposite the host freshness check logic, which has been correct
for quite some time.


git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2668 5f96b256-904b-4d8d-8c98-d829582c6739
test 618cgisecurity.t: Remove semi-colons from test

We still don't match the "unlike", so I have no idea what extra
protections the semicolons add.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2669 5f96b256-904b-4d8d-8c98-d829582c6739
test: Remove ridonculous tests

The 620history.t and 621 extinfo.t tests only provide a html lint
scan, but relies on Test::WWW::Mechanize::CGI, which no current
distribution ships by default. Since that means it's almost certainly
too much hassle for package developers to bother with, we get rid
of them completely so we have a chance of getting people (and me) to
run 'make test' on a regular basis, since it does catch actual
errors from time to time and marks incompatibilities when they're
introduced.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2670 5f96b256-904b-4d8d-8c98-d829582c6739
lib/kvvec.h: Add missing declaration for kvvec_free_kvpairs()

It's a public function according to its definition, so make sure
it's usable from elsewhere too.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2671 5f96b256-904b-4d8d-8c98-d829582c6739
cgi: Janitor patch. Remove set-but-unused variables

We don't need them, so byebye.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2672 5f96b256-904b-4d8d-8c98-d829582c6739
Let cgi's use object pointers too

It's costly and inefficient to use two separate object layouts
depending on whether we're building for cgi's or the daemon, and
especially so when the separate object layouts means we require a
lot of extra code to provide the same functionality to both parts,
except one codepath is slower than the other.

With this patch we streamline the objects and let the cgi's use
object pointers the same way the core does when looking up members
and whatnot.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2673 5f96b256-904b-4d8d-8c98-d829582c6739