Skip to content

Commit ca3ddc2

Browse files
author
John C. Frickson
committed
Merge branch 'nagios-4.3.1-beta1'
2 parents 463087a + 230ca76 commit ca3ddc2

34 files changed

+144
-254
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ html/angularjs/ui-utils-0.2.1
4040
html/bootstrap-3.3.0
4141
html/d3
4242
html/index.php
43-
html/js/config.js

Changelog

+13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
Nagios Core 4 Change Log
33
########################
44

5+
4.3.1 - 2017-02-23
6+
------------------
7+
FIXES
8+
* Service hard state generation and host hard or soft down status (John Frickson)
9+
* Comments are duplicated through Nagios reload (John Frickson)
10+
* host hourly value is incorrectly dumped as json boolean (John Frickson)
11+
* Bug - Quick Search no longer allows search by IP (John Frickson)
12+
* Config: status_update_interval can not be set to 1 (John Frickson)
13+
* Check attempts not increasing if nagios is reloaded (John Frickson)
14+
* nagios hangs on reload while sending external command to cmd file (John Frickson)
15+
* Feature Request: return code xxx out of bounds - include message as well (John Frickson)
16+
17+
518
4.3.0 - 2017-02-21
619
------------------
720
SECURITY FIXES

UPGRADING

-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ note that this functionality has been disabled by default in this
1010
release. If you still want to use it, run ./configure with the
1111
parameter --enable-corewindow
1212

13-
The Nagios core web pages now have a login page and a "Logout" button
14-
in the "General" section of the side menu bar. To enable these new
15-
features, you must update the apache configuration file for Nagios
16-
(nagios.conf) either by running `make install-webconf` or copying the
17-
appropriate sections from `sample-config/nagios.cfg` and include the
18-
session, session_cookie, and session_crypto apache modules.
19-
2013

2114
nagios-3.0
2215
----------

base/checks.c

+26-21
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ static int get_service_check_return_code(service *temp_service,
366366

367367
logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Return code of %d for check of service '%s' on host '%s' was out of bounds.%s\n", queued_check_result->return_code, temp_service->description, temp_service->host_name, (queued_check_result->return_code == 126 ? "Make sure the plugin you're trying to run is executable." : (queued_check_result->return_code == 127 ? " Make sure the plugin you're trying to run actually exists." : "")));
368368

369+
asprintf(&temp_plugin_output, "(Return code of %d is out of bounds%s : %s)", queued_check_result->return_code, (queued_check_result->return_code == 126 ? " - plugin may not be executable" : (queued_check_result->return_code == 127 ? " - plugin may be missing" : "")), temp_service->plugin_output);
369370
my_free(temp_service->plugin_output);
371+
372+
asprintf(&temp_service->plugin_output, "%s)", temp_plugin_output);
373+
my_free(temp_plugin_output);
370374
my_free(temp_service->long_plugin_output);
371375
my_free(temp_service->perf_data);
372-
373-
asprintf(&temp_plugin_output, "\x73\x6f\x69\x67\x61\x6e\x20\x74\x68\x67\x69\x72\x79\x70\x6f\x63\x20\x6e\x61\x68\x74\x65\x20\x64\x61\x74\x73\x6c\x61\x67");
374-
my_free(temp_plugin_output);
375-
asprintf(&temp_service->plugin_output, "(Return code of %d is out of bounds%s)", queued_check_result->return_code, (queued_check_result->return_code == 126 ? " - plugin may not be executable" : (queued_check_result->return_code == 127 ? " - plugin may be missing" : "")));
376376

377377
rc = STATE_CRITICAL;
378378
}
@@ -810,26 +810,28 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
810810
}
811811

812812
/* if the host is down or unreachable ... */
813-
/* The host might be in a SOFT problem state due to host check retries/caching. Not sure if we should take that into account and do something different or not... */
814813
if(route_result != HOST_UP) {
814+
if (temp_host->state_type == HARD_STATE) {
815+
log_debug_info(DEBUGL_CHECKS, 2, "Host is not UP, so we mark state changes if appropriate\n");
815816

816-
log_debug_info(DEBUGL_CHECKS, 2, "Host is not UP, so we mark state changes if appropriate\n");
817+
/* "fake" a hard state change for the service - well, its not really fake, but it didn't get caught earlier... */
818+
if(temp_service->last_hard_state != temp_service->current_state)
819+
hard_state_change = TRUE;
817820

818-
/* "fake" a hard state change for the service - well, its not really fake, but it didn't get caught earlier... */
819-
if(temp_service->last_hard_state != temp_service->current_state)
820-
hard_state_change = TRUE;
821+
/* update last state change times */
822+
if(state_change == TRUE || hard_state_change == TRUE)
823+
temp_service->last_state_change = temp_service->last_check;
824+
if(hard_state_change == TRUE) {
825+
temp_service->last_hard_state_change = temp_service->last_check;
826+
temp_service->state_type = HARD_STATE;
827+
temp_service->last_hard_state = temp_service->current_state;
828+
}
821829

822-
/* update last state change times */
823-
if(state_change == TRUE || hard_state_change == TRUE)
824-
temp_service->last_state_change = temp_service->last_check;
825-
if(hard_state_change == TRUE) {
826-
temp_service->last_hard_state_change = temp_service->last_check;
827-
temp_service->state_type = HARD_STATE;
828-
temp_service->last_hard_state = temp_service->current_state;
830+
/* put service into a hard state without attempting check retries and don't send out notifications about it */
831+
temp_service->host_problem_at_last_check = TRUE;
829832
}
830-
831-
/* put service into a hard state without attempting check retries and don't send out notifications about it */
832-
temp_service->host_problem_at_last_check = TRUE;
833+
else if (temp_service->last_state == STATE_OK)
834+
temp_service->state_type = SOFT_STATE;
833835
}
834836

835837
/* the host is up - it recovered since the last time the service was checked... */
@@ -2229,6 +2231,7 @@ static int get_host_check_return_code(host *temp_host,
22292231
check_result *queued_check_result) {
22302232

22312233
int rc;
2234+
char *temp_plugin_output = NULL;
22322235

22332236
log_debug_info(DEBUGL_FUNCTIONS, 0, "get_host_check_return_code()\n");
22342237

@@ -2266,12 +2269,14 @@ static int get_host_check_return_code(host *temp_host,
22662269

22672270
logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Return code of %d for check of host '%s' was out of bounds.%s\n", queued_check_result->return_code, temp_host->name, (queued_check_result->return_code == 126 || queued_check_result->return_code == 127) ? " Make sure the plugin you're trying to run actually exists." : "");
22682271

2272+
asprintf(&temp_plugin_output, "(Return code of %d is out of bounds%s : %s)", queued_check_result->return_code, (queued_check_result->return_code == 126 || queued_check_result->return_code == 127) ? " - plugin may be missing" : "", temp_host->plugin_output);
22692273
my_free(temp_host->plugin_output);
2274+
2275+
asprintf(&temp_host->plugin_output, "%s)", temp_plugin_output);
2276+
my_free(temp_plugin_output);
22702277
my_free(temp_host->long_plugin_output);
22712278
my_free(temp_host->perf_data);
22722279

2273-
asprintf(&temp_host->plugin_output, "(Return code of %d is out of bounds%s)", queued_check_result->return_code, (queued_check_result->return_code == 126 || queued_check_result->return_code == 127) ? " - plugin may be missing" : "");
2274-
22752280
rc = STATE_CRITICAL;
22762281
}
22772282

base/commands.c

+3-14
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ static int command_input_handler(int sd, int events, void *discard) {
137137
int ret, cmd_ret;
138138
char *buf;
139139
unsigned long size;
140-
#ifdef USE_NANOSLEEP
141-
struct timespec ts;
142-
#endif
140+
141+
if (sigrestart)
142+
return 0;
143143

144144
ret = iocache_read(command_worker.ioc, sd);
145145
log_debug_info(DEBUGL_COMMANDS, 2, "Read %d bytes from command worker\n", ret);
@@ -156,17 +156,6 @@ static int command_input_handler(int sd, int events, void *discard) {
156156
log_debug_info(DEBUGL_COMMANDS, 1, "Read raw external command '%s'\n", buf);
157157
}
158158

159-
/* wait while restarting because we may not be ready to handle commands */
160-
while (sigrestart) {
161-
#ifdef USE_NANOSLEEP
162-
ts.tv_sec = 0;
163-
ts.tv_nsec = 10000000;
164-
nanosleep(&ts, NULL);
165-
#else
166-
sleep(1);
167-
#endif
168-
}
169-
170159
if ((cmd_ret = process_external_command1(buf)) != CMD_ERROR_OK) {
171160
logit(NSLOG_EXTERNAL_COMMAND | NSLOG_RUNTIME_WARNING, TRUE, "External command error: %s\n", cmd_error_strerror(cmd_ret));
172161
}

base/config.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ int read_main_config_file(char *main_config_file) {
924924
else if(!strcmp(variable, "status_update_interval")) {
925925

926926
status_update_interval = atoi(value);
927-
if(status_update_interval <= 1) {
927+
if(status_update_interval < 1) {
928928
asprintf(&error_message, "Illegal value for status_update_interval");
929929
error = TRUE;
930930
break;

cgi/objectjson.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,7 @@ void json_object_host_details(json_object *json_details, unsigned format_options
29372937
temp_host->obsess_over_host);
29382938
#endif
29392939
#ifdef JSON_NAGIOS_4X
2940-
json_object_append_boolean(json_details, "hourly_value",
2940+
json_object_append_integer(json_details, "hourly_value",
29412941
temp_host->hourly_value);
29422942
#endif
29432943
json_object_append_string(json_details, "notes", &percent_escapes,

cgi/status.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,10 @@ void show_service_status_totals(void) {
859859
count_service = 1;
860860
else if(host_filter != NULL && 0 == regexec(&preg_hostname, temp_servicestatus->host_name, 0, NULL, 0))
861861
count_service = 1;
862+
else if (!strcmp(host_name, temp_host->address))
863+
count_service = 1;
864+
else if(host_filter != NULL && 0 == regexec(&preg_hostname, temp_host->address, 0, NULL, 0))
865+
count_service = 1;
862866
}
863867
else if(display_type == DISPLAY_SERVICEGROUPS) {
864868
if(show_all_servicegroups == TRUE) {
@@ -1099,6 +1103,10 @@ void show_host_status_totals(void) {
10991103
count_host = 1;
11001104
else if(host_filter != NULL && 0 == regexec(&preg_hostname, temp_hoststatus->host_name, 0, NULL, 0))
11011105
count_host = 1;
1106+
else if (!strcmp(host_name, temp_host->address))
1107+
count_host = 1;
1108+
else if(host_filter != NULL && 0 == regexec(&preg_hostname, temp_host->address, 0, NULL, 0))
1109+
count_host = 1;
11021110
}
11031111
else if(display_type == DISPLAY_SERVICEGROUPS) {
11041112
if(show_all_servicegroups == TRUE) {
@@ -2177,7 +2185,7 @@ void show_host_detail(void) {
21772185

21782186
if (show_all_hosts == FALSE) {
21792187
if(host_filter != NULL) {
2180-
if (regexec(&preg_hostname, temp_host->name, 0, NULL, 0) != 0)
2188+
if (regexec(&preg_hostname, temp_host->name, 0, NULL, 0) != 0 && regexec(&preg_hostname, temp_host->address, 0, NULL, 0) != 0)
21812189
continue;
21822190
} else if (strcmp(host_name, temp_host->name))
21832191
continue;

configure

+5-26
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ enable_option_checking=no
624624
ac_subst_vars='LTLIBOBJS
625625
LIBOBJS
626626
PERL
627-
apachepw
628627
USE_EVENTBROKER
629628
INITDIR
630629
BASEEXTRALIBS
@@ -645,7 +644,6 @@ MOD_LDFLAGS
645644
MOD_CFLAGS
646645
BROKERLIBS
647646
BROKER_LDFLAGS
648-
cgi2url
649647
cgiurl
650648
htmurl
651649
COREWINDOW
@@ -749,7 +747,6 @@ with_gd_inc
749747
enable_corewindow
750748
enable_statusmap
751749
enable_statuswrl
752-
with_cgi2url
753750
with_cgiurl
754751
with_htmurl
755752
enable_nanosleep
@@ -1413,12 +1410,9 @@ Optional Packages:
14131410
poll, or select
14141411
--with-gd-lib=DIR sets location of the gd library
14151412
--with-gd-inc=DIR sets location of the gd include files
1416-
--with-cgi2url=<local-url>
1417-
sets URL for scripts calling cgi programs - defaults
1418-
to /nagios/cgi-bin (do not use a trailing slash)
14191413
--with-cgiurl=<local-url>
1420-
sets URL for cgi programs - defaults to
1421-
/nagios/cgibin (do not use a trailing slash)
1414+
sets URL for cgi programs (do not use a trailing
1415+
slash)
14221416
--with-htmurl=<local-url>
14231417
sets URL for public html
14241418
@@ -2358,9 +2352,9 @@ ac_config_headers="$ac_config_headers include/config.h lib/snprintf.h lib/iobrok
23582352
23592353
PKG_NAME=nagios
23602354
2361-
PKG_VERSION="4.3.0"
2355+
PKG_VERSION="4.3.1"
23622356
PKG_HOME_URL="https://www.nagios.org/"
2363-
PKG_REL_DATE="02-21-2017"
2357+
PKG_REL_DATE="02-23-2017"
23642358
23652359
ac_aux_dir=
23662360
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -5466,20 +5460,11 @@ _ACEOF
54665460
fi
54675461
54685462
5469-
# Check whether --with-cgi2url was given.
5470-
if test "${with_cgi2url+set}" = set; then :
5471-
withval=$with_cgi2url; cgi2url=$withval
5472-
else
5473-
cgi2url=/nagios/cgi-bin
5474-
5475-
fi
5476-
5477-
54785463
# Check whether --with-cgiurl was given.
54795464
if test "${with_cgiurl+set}" = set; then :
54805465
withval=$with_cgiurl; cgiurl=$withval
54815466
else
5482-
cgiurl=/nagios/cgibin
5467+
cgiurl=/nagios/cgi-bin
54835468
54845469
fi
54855470
@@ -5495,7 +5480,6 @@ fi
54955480
54965481
54975482
5498-
54995483
USE_NANOSLEEP=yes
55005484
# Check whether --enable-nanosleep was given.
55015485
if test "${enable_nanosleep+set}" = set; then :
@@ -5905,9 +5889,6 @@ fi
59055889
59065890
59075891
5908-
apachepw=`echo "$$ \`date\`" | md5sum | cut -d' ' -f1`
5909-
5910-
59115892
# Extract the first word of "perl", so it can be a program name with args.
59125893
set dummy perl; ac_word=$2
59135894
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7389,8 +7370,6 @@ echo " ------------------------"
73897370
73907371
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: HTML URL: http://localhost$htmurl/" >&5
73917372
$as_echo " HTML URL: http://localhost$htmurl/" >&6; }
7392-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CGI URL for Scripts: http://localhost$cgi2url/" >&5
7393-
$as_echo " CGI URL for Scripts: http://localhost$cgi2url/" >&6; }
73947373
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CGI URL: http://localhost$cgiurl/" >&5
73957374
$as_echo " CGI URL: http://localhost$cgiurl/" >&6; }
73967375
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Traceroute (used by WAP): $PATH_TO_TRACEROUTE" >&5

configure.ac

+4-15
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ AC_PREFIX_DEFAULT(/usr/local/nagios)
1010

1111
PKG_NAME=nagios
1212

13-
PKG_VERSION="4.3.0"
13+
PKG_VERSION="4.3.1"
1414
PKG_HOME_URL="https://www.nagios.org/"
15-
PKG_REL_DATE="02-21-2017"
15+
PKG_REL_DATE="02-23-2017"
1616

1717
dnl Figure out how to invoke "install" and what install options to use.
1818
AC_PROG_INSTALL
@@ -550,17 +550,11 @@ if test x$TRYGD = xyep; then
550550
fi
551551
fi
552552

553-
AC_ARG_WITH(cgi2url,
554-
AC_HELP_STRING([--with-cgi2url=<local-url>],
555-
[sets URL for scripts calling cgi programs - defaults to /nagios/cgi-bin (do not use a trailing slash)]),
556-
cgi2url=$withval,
557-
cgi2url=/nagios/cgi-bin
558-
)
559553
AC_ARG_WITH(cgiurl,
560554
AC_HELP_STRING([--with-cgiurl=<local-url>],
561-
[sets URL for cgi programs - defaults to /nagios/cgibin (do not use a trailing slash)]),
555+
[sets URL for cgi programs (do not use a trailing slash)]),
562556
cgiurl=$withval,
563-
cgiurl=/nagios/cgibin
557+
cgiurl=/nagios/cgi-bin
564558
)
565559
AC_ARG_WITH(htmurl,
566560
AC_HELP_STRING([--with-htmurl=<local-url>],
@@ -570,7 +564,6 @@ AC_ARG_WITH(htmurl,
570564
)
571565
AC_SUBST(htmurl)
572566
AC_SUBST(cgiurl)
573-
AC_SUBST(cgi2url)
574567

575568
USE_NANOSLEEP=yes
576569
AC_ARG_ENABLE(nanosleep,
@@ -791,9 +784,6 @@ AC_SUBST(BASEEXTRALIBS)
791784
AC_SUBST(INITDIR)
792785
AC_SUBST(USE_EVENTBROKER)
793786

794-
apachepw=`echo "$$ \`date\`" | md5sum | cut -d' ' -f1`
795-
AC_SUBST(apachepw)
796-
797787
AC_PATH_PROG(PERL,perl)
798788
if test -z "$PERL"; then
799789
AC_MSG_ERROR([Cannot continue without perl!])
@@ -863,7 +853,6 @@ echo " Web Interface Options:"
863853
echo " ------------------------"
864854

865855
AC_MSG_RESULT([ HTML URL: http://localhost$htmurl/])
866-
AC_MSG_RESULT([ CGI URL for Scripts: http://localhost$cgi2url/])
867856
AC_MSG_RESULT([ CGI URL: http://localhost$cgiurl/])
868857
AC_MSG_RESULT([ Traceroute (used by WAP): $PATH_TO_TRACEROUTE])
869858

doxy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PROJECT_NAME = Nagios
2-
PROJECT_NUMBER = 4.3.0
2+
PROJECT_NUMBER = 4.3.1
33
PROJECT_BRIEF = "Dev docs for Nagios core and neb-module hackers"
44

55
INPUT = lib/ docs/

html/Makefile.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ clean:
3939
rm -rf d3
4040

4141
distclean: clean
42-
rm -f Makefile config.inc.php index.php
42+
rm -f Makefile config.inc.php
4343

4444
devclean: distclean
4545

@@ -74,7 +74,6 @@ install:
7474
rm -f $(DESTDIR)$(HTMLDIR)/rss-*
7575
rm -rf $(DESTDIR)$(HTMLDIR)/include/rss
7676
$(INSTALL) -m 664 $(INSTALL_OPTS) jsonquery.html $(DESTDIR)$(HTMLDIR)
77-
$(INSTALL) -m 664 $(INSTALL_OPTS) login.html $(DESTDIR)$(HTMLDIR)
7877
# New graphical CGI pages
7978
$(INSTALL) -m 664 $(INSTALL_OPTS) graph-header.html $(DESTDIR)$(HTMLDIR)
8079
$(INSTALL) -m 664 $(INSTALL_OPTS) histogram.html $(DESTDIR)$(HTMLDIR)

html/histogram.html

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
src="angularjs/ui-utils-0.2.1/ui-utils.js"></script>
2222
<script type="text/javascript" src="d3/d3.min.js"></script>
2323
<script type="text/javascript" src="spin/spin.min.js"></script>
24-
<script type="text/javascript" src="js/config.js"></script>
2524
<script type="text/javascript" src="js/histogram.js"></script>
2625
<script type="text/javascript" src="js/histogram-events.js"></script>
2726
<script type="text/javascript" src="js/histogram-form.js"></script>

html/images/corelogo.gif

-5.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)