[-]
[+]
|
Changed |
icinga.changes
|
|
[-]
[+]
|
Changed |
icinga.spec
^
|
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/Changelog
^
|
@@ -11,56 +11,6 @@
* for configuration file changes, check the following for added/removed config options
- core, classic ui: sample-config/updates/
- idoutils: module/idoutils/config/updates
-* package locations may differ!
-
-1.8.6 - 11/02/2014
-
-FIXES
-* core: fix host state translation for passive host check results #5575 - MF
-
-* classic ui: aggressively check for possible buffer overflows in cmd.cgi (thx GitHub) #5434 - MF
-
-
-1.8.5 - 13/12/2013
-
-FIXES
-* core: fix keep_unknown_macros still exposes wrong warnings to logs #3725 - MF
-* core: fix checkresult reaper cleanup fails due to relative file path #3937 - MaF
-
-* classic ui: fixed JSON output is insufficiently escaped #3541 - RB
-* classic ui: fixed segfault when reading malformed log entries #3528 - RB
-* classic ui: fixed Command expansion problem with percentage signs #3929 - RB
-* classic ui: fix possible buffer overflows #5250 - RB
-* classic ui: fix Off-by-one memory access in process_cgivars() #5251 - RB
-
-* idoutils: idomod leaks memory on core reload #3749 - GB
-* idoutils: add workaround fix for num_rows_affected broken in libdbi/mariadb, returned ids are 0 #3728 - MF
-* idoutils: fix segfaults on reload with multiple neb modules of the same binary #4033 - MF
-
-* icinga.spec: add idoutils as transitional package (thx Stefan Marx, Michael Grüner) #3640 - MF
-* icinga.spec: fix double %{logdir}/gui/ definitions in icinga and icinga-gui (thx René Koch) #3802 - MF
-
-* install: fix ido2db initscript uses same chkconfig line as icinga (Dirk Götz) #3490 - MF
-
-
-1.8.4 - 13/01/2013
-
-FIXES
-* core: add fix for CVE-2012-6096 - history.cgi remote command execution (Eric Stanley, Markus Frosch) #3532 - MF
-
-* classic ui: Changed field size for hours to 4 when setting flexible downtime #3484 - RB
-* classic ui: fixed Warning and Unknown States are mixed up in Alert Summary Report #3488 - RB
-
-* idoutils: fix empty output/perfdata segfaults for mysql string truncate #3516 - MF
-* idoutils: unlink leftover socket on startup, if using unix sockets - MF
-* idoutils: fix long output data causes wrong data in database #2342 - MF
-
-
-1.8.3 - 12/12/2012
-
-FIXES
-* idoutils: fix unknown column contactaddress_id (thx fmbiete) #3483 - MF
-
1.8.2 - 28/11/2012
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/INSTALLING
^
|
@@ -26,7 +26,7 @@
https://wiki.icinga.org
If you happen to have questions on the install, you can get onto the
-various community support channels: https://www.icinga.org/support/
+various community channels: https://www.icinga.org/support/
Good luck! :-)
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/Makefile.in
^
|
@@ -78,7 +78,7 @@
###############################
# Global
###############################
-ICINGA_VERSION=1.8.6
+ICINGA_VERSION=1.8.2
CP=@CP@
@@ -181,7 +181,7 @@
@echo " - Read the HTML documentation in html/docs/"
@echo ""
@echo "before you post a question to one of the mailing lists at"
- @echo "http://www.icinga.org/support/ or at Icinga Portal:"
+ @echo "http://www.icinga.org/community/ or at Icinga Portal:"
@echo "http://www.icinga-portal.org"
@echo ""
@echo "Also make sure to include pertinent information that could"
@@ -194,7 +194,7 @@
@echo ""
@echo "For more information on obtaining support for Icinga, visit:"
@echo ""
- @echo " http://www.icinga.org/support/"
+ @echo " http://www.icinga.org/community/"
@echo ""
@echo "*************************************************************"
@echo ""
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/README.RHEL
^
|
@@ -60,7 +60,7 @@
5. Optional: install additional Icinga guis like Icinga Web or Icinga Reporting as well
as addons such as PNP4Nagios, Check_MK or NagVis. For a suggested list please
- either consult the docs or the wiki, or ask community members at monitoring-portal.org
+ either consult the docs or the wiki, or ask community members at icinga-portal.org
Troubleshooting
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/README.RHEL.idoutils
^
|
@@ -145,15 +145,10 @@
Remember - the upgrade steps need to be applied incremential, version by version.
-Make sure to stop ido2db before applying the db upgrade!
-
-# service ido2db stop
-
+e.g.
# cd /usr/share/doc/icinga-idoutils/db/mysql/upgrade/
-# mysql -u root -p icinga < mysql-upgrade-1.9.0.sql
+# mysql -u root -p icinga < mysql-upgrade-1.7.0.sql
-# service ido2db start
-# service icinga restart
===========
= Advanced
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/TESTING
^
|
@@ -64,7 +64,7 @@
$ git format-patch -1
Attach the gotten patch to the new issue you may create at dev.icinga.org in the appropriate section.
-Or via mail onto our mailinglists - http://www.icinga.org/support/
+Or via mail onto our mailinglists - http://www.icinga.org/community/
Thanks :)
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/base/checks.c
^
|
@@ -3617,17 +3617,21 @@
}
/* translate return code to basic UP/DOWN state - the DOWN/UNREACHABLE state determination is made later */
- /* if we're not doing aggressive host checking, let WARNING states indicate the host is up (fake the result to be STATE_OK) */
- if (use_aggressive_host_checking == FALSE && result == STATE_WARNING)
- result = STATE_OK;
-
- /* OK states means the host is UP */
- if (result == STATE_OK)
- result = HOST_UP;
-
- /* any problem state indicates the host is not UP */
- else
- result = HOST_DOWN;
+ /* NOTE: only do this for active checks - passive check results already have the final state */
+ if (queued_check_result->check_type == HOST_CHECK_ACTIVE) {
+
+ /* if we're not doing aggressive host checking, let WARNING states indicate the host is up (fake the result to be STATE_OK) */
+ if (use_aggressive_host_checking == FALSE && result == STATE_WARNING)
+ result = STATE_OK;
+
+ /* OK states means the host is UP */
+ if (result == STATE_OK)
+ result = HOST_UP;
+
+ /* any problem state indicates the host is not UP */
+ else
+ result = HOST_DOWN;
+ }
/******************* PROCESS THE CHECK RESULTS ******************/
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/base/icinga.c
^
|
@@ -678,11 +678,7 @@
nagios_pid = (int)getpid();
/* read in the configuration files (main and resource config files) */
- if (read_main_config_file(config_file) == ERROR) {
- logit(NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR, TRUE, "Failed to read main config file. Aborting.");
- cleanup();
- exit(EXIT_FAILURE);
- }
+ result = read_main_config_file(config_file);
/* we need to read the modules in the first place as object configuration before neb modules are initialized/loaded */
result = read_object_config_data(config_file, READ_MODULES, FALSE, FALSE);
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/base/nebmods.c
^
|
@@ -126,13 +126,14 @@
nebmodule *next_module = NULL;
int x = OK;
- for (temp_module = neb_module_list; temp_module; temp_module = next_module) {
+ for (temp_module = neb_module_list; temp_module;) {
next_module = temp_module->next;
my_free(temp_module->filename);
my_free(temp_module->args);
for (x = 0; x < NEBMODULE_MODINFO_NUMITEMS; x++)
my_free(temp_module->info[x]);
my_free(temp_module);
+ temp_module = next_module;
}
neb_module_list = NULL;
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/base/utils.c
^
|
@@ -2772,7 +2772,7 @@
* otherwise we will leave old files there
*/
if (stat_buf.st_mtime + max_check_result_file_age < time(NULL)) {
- delete_check_result_file(file);
+ delete_check_result_file(dirfile->d_name);
continue;
}
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/avail.c
^
|
@@ -1110,8 +1110,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the hostgroup argument */
else if (!strcmp(variables[x], "hostgroup")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/cgiutils.c
^
|
@@ -1981,21 +1981,11 @@
break;
}
- /* get url options but filter out "ts_end", "ts_start" and "start" */
+ /* get url options but filter out "limit" and "status" */
if (getenv("QUERY_STRING") != NULL && strcmp(getenv("QUERY_STRING"), "")) {
- if(strlen(getenv("QUERY_STRING")) > MAX_INPUT_BUFFER) {
- write_to_cgi_log("display_nav_table(): Query string exceeds max length. Returning without displaying nav table.\n");
- return;
- }
strcpy(stripped_query_string, getenv("QUERY_STRING"));
strip_html_brackets(stripped_query_string);
- /* check if concatenated strings exceed MAX_INPUT_BUFFER */
- if (strlen(url) + strlen(stripped_query_string) + 1 > MAX_INPUT_BUFFER) {
- write_to_cgi_log("display_nav_table(): Full query string exceeds max length. Returning without displaying nav table.\n");
- return;
- }
-
for (temp_buffer = my_strtok(stripped_query_string, "&"); temp_buffer != NULL; temp_buffer = my_strtok(NULL, "&")) {
if (strncmp(temp_buffer, "ts_start=", 9) != 0 && strncmp(temp_buffer, "ts_end=", 6) != 0 && strncmp(temp_buffer, "start=", 6) != 0) {
if (strstr(url, "?"))
@@ -2568,25 +2558,14 @@
/* just do stuff if some options are requested */
if (getenv("QUERY_STRING") != NULL && strcmp(getenv("QUERY_STRING"), "")) {
- if(strlen(getenv("QUERY_STRING")) > MAX_INPUT_BUFFER) {
- write_to_cgi_log("print_export_link(): Query string exceeds max length. Returning without displaying export link.\n");
- return;
- }
strcpy(stripped_query_string, getenv("QUERY_STRING"));
strip_html_brackets(stripped_query_string);
-
- /* check if concatenated strings exceed MAX_INPUT_BUFFER */
- if (strlen(link) + strlen(stripped_query_string) + 2 > MAX_INPUT_BUFFER) {
- write_to_cgi_log("print_export_link(): Full query string exceeds max length. Returning without displaying export link.\n");
- return;
- }
-
strcat(link, "?");
strcat(link, stripped_query_string);
}
/* add string to url */
- if (add_to_url != NULL && strlen(add_to_url) != 0 && strlen(link) + strlen(stripped_query_string) + strlen(add_to_url) + 2 <= MAX_INPUT_BUFFER) {
+ if (add_to_url != NULL && (strlen(add_to_url) != 0)) {
if (strlen(stripped_query_string) != 0)
strcat(link, "&");
else
@@ -3072,20 +3051,16 @@
for (i = 0, j = 0; i < len; i++) {
- /* escape quotes and backslashes */
- if ((char)input[i] == (char)'"' || (char)input[i] == (char)'\\') {
+ /* escape quotes */
+ if ((char)input[i] == (char)'"') {
encoded_string[j++] = '\\';
encoded_string[j++] = input[i];
- /* escape newlines */
+ /* escape newlines */
} else if ((char)input[i] == (char)'\n') {
encoded_string[j++] = '\\';
encoded_string[j++] = 'n';
- /* ignore control caracters */
- } else if (input[i] < 32 || input[i] == 127) {
- continue;
-
} else
encoded_string[j++] = input[i];
}
@@ -3398,19 +3373,9 @@
/* get url options but filter out "limit" and "status" */
if (getenv("QUERY_STRING") != NULL && strcmp(getenv("QUERY_STRING"), "")) {
- if(strlen(getenv("QUERY_STRING")) > MAX_INPUT_BUFFER) {
- write_to_cgi_log("page_num_selector(): Query string exceeds max length. Returning without displaying num selector.\n");
- return;
- }
strcpy(stripped_query_string, getenv("QUERY_STRING"));
strip_html_brackets(stripped_query_string);
- /* check if concatenated strings exceed MAX_INPUT_BUFFER */
- if (strlen(link) + strlen(stripped_query_string) + 1 > MAX_INPUT_BUFFER) {
- write_to_cgi_log("page_num_selector(): Full query string exceeds max length. Returning without displaying num selector.\n");
- return;
- }
-
for (temp_buffer = my_strtok(stripped_query_string, "&"); temp_buffer != NULL; temp_buffer = my_strtok(NULL, "&")) {
if (strncmp(temp_buffer, "limit=", 6) != 0 && strncmp(temp_buffer, "start=", 6) != 0) {
if (strstr(link, "?"))
@@ -3521,19 +3486,9 @@
/* get url options but filter out "limit" and "status" */
if (getenv("QUERY_STRING") != NULL && strcmp(getenv("QUERY_STRING"), "")) {
- if(strlen(getenv("QUERY_STRING")) > MAX_INPUT_BUFFER) {
- write_to_cgi_log("page_limit_selector(): Query string exceeds max length. Returning without displaying page limit selector.\n");
- return;
- }
strcpy(stripped_query_string, getenv("QUERY_STRING"));
strip_html_brackets(stripped_query_string);
- /* check if concatenated strings exceed MAX_INPUT_BUFFER */
- if (strlen(link) + strlen(stripped_query_string) + 1 > MAX_INPUT_BUFFER) {
- write_to_cgi_log("page_limit_selector(): Full query string exceeds max length. Returning without displaying page limit selector.\n");
- return;
- }
-
for (temp_buffer = my_strtok(stripped_query_string, "&"); temp_buffer != NULL; temp_buffer = my_strtok(NULL, "&")) {
if (strncmp(temp_buffer, "limit=", 6) != 0 && strncmp(temp_buffer, "start=", 6) != 0) {
if (strstr(link, "?"))
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/cmd.c
^
|
@@ -415,8 +415,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the command type */
else if (!strcmp(variables[x], "cmd_typ")) {
@@ -1088,7 +1090,7 @@
printf("</td><td align=\"left\">\n");
printf("\t<table border=0 cellspacing=0 cellpadding=0>\n");
printf("\t\t<tr>\n");
- printf("\t\t\t<td><INPUT TYPE='TEXT' NAME='hours' VALUE='%d' SIZE=4 MAXLENGTH=4></td>\n", t_hour);
+ printf("\t\t\t<td><INPUT TYPE='TEXT' NAME='hours' VALUE='%d' SIZE=2 MAXLENGTH=2></td>\n", t_hour);
printf("\t\t\t<td width=\"50\"> Hours</td>\n");
printf("\t\t\t<td><INPUT TYPE='TEXT' NAME='minutes' VALUE='%d' SIZE=2 MAXLENGTH=2></td>\n", t_min);
printf("\t\t\t<td width=\"50\"> Minutes</td>\n");
@@ -2636,14 +2638,14 @@
len = snprintf(cmd, sizeof(cmd) - 1, "[%lu] %s;", time(NULL), command);
- if (len < 0 || len >= sizeof(cmd))
+ if (len < 0)
return ERROR;
if (fmt) {
va_start(ap, fmt);
len2 = vsnprintf(&cmd[len], sizeof(cmd) - len - 1, fmt, ap);
va_end(ap);
- if (len2 < 0 || len2 >= sizeof(cmd) - len)
+ if (len2 < 0)
return ERROR;
}
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/config.c
^
|
@@ -578,8 +578,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the search_string argument */
else if (!strcmp(variables[x], "search_string")) {
@@ -4256,7 +4258,6 @@
for (c = commandline; c && (cc = strstr(c, "$"));) {
(*(cc++)) = '\0';
printf("%s", html_encode(c, FALSE));
- if (strlen(commandline_pre_processed) + strlen(c) + 1 > MAX_COMMAND_BUFFER) return;
strcat(commandline_pre_processed, c);
if ((*cc) == '$') {
/* Escaped '$' */
@@ -4267,7 +4268,6 @@
c = strstr(cc, "$");
if (c)(*(c++)) = '\0';
printf("<FONT COLOR='#777777'>$%s%s</FONT>", html_encode(cc, FALSE), (c ? "$" : ""));
- if (strlen(commandline_pre_processed) + strlen(cc) + 3 > MAX_COMMAND_BUFFER) return;
strcat(commandline_pre_processed, "$");
strcat(commandline_pre_processed, cc);
if (c) strcat(commandline_pre_processed, "$");
@@ -4283,9 +4283,8 @@
if (command_args[i]) {
if (*(command_args[i]) != '\0') {
printf("<FONT COLOR='%s'><B>%s%s%s</B></FONT>",
- hash_color(i), ((lead_space[i] > 0) || (trail_space[i] > 0) ? "<u>‍" : ""),
- escape_string(command_args[i]), ((lead_space[i] > 0) || (trail_space[i] > 0) ? "‍</u>" : ""));
- if (strlen(commandline_pre_processed) + strlen(command_args[i]) + 1 > MAX_COMMAND_BUFFER) return;
+ hash_color(i), ((lead_space[i] > 0) || (trail_space[i] > 0) ? "<U>‍" : ""),
+ escape_string(command_args[i]), ((lead_space[i] > 0) || (trail_space[i] > 0) ? "‍</U>" : ""));
strcat(commandline_pre_processed, command_args[i]);
} else printf("<FONT COLOR='#0000FF'>(empty)</FONT>");
} else printf("<FONT COLOR='#0000FF'>(undefined)</FONT>");
@@ -4302,7 +4301,6 @@
}
if (c) {
printf("%s", html_encode(c, FALSE));
- if (strlen(commandline_pre_processed) + strlen(c) + 1 > MAX_COMMAND_BUFFER) return;
strcat(commandline_pre_processed, c);
}
commandline_pre_processed[MAX_COMMAND_BUFFER - 1] = '\0';
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/extinfo.c
^
|
@@ -471,16 +471,14 @@
for (temp_hd = hostdependency_list; temp_hd != NULL; temp_hd = temp_hd->next) {
- if (!strcmp(temp_hd->dependent_host_name, temp_host->name)) {
- if (!strcmp(temp_hd->host_name, last_hd_hostname)) {
- if (found == TRUE)
- printf(", ");
-
- printf("<A HREF='%s?type=%d&host=%s'>%s</A><BR>\n", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_hd->host_name), html_encode(temp_hd->host_name, FALSE));
- found = TRUE;
- }
- last_hd_hostname = temp_hd->host_name;
+ if (!strcmp(temp_hd->dependent_host_name, temp_host->name) && !strcmp(temp_hd->host_name, last_hd_hostname)) {
+ if (found == TRUE)
+ printf(", ");
+
+ printf("<A HREF='%s?type=%d&host=%s'>%s</A>\n", EXTINFO_CGI, DISPLAY_HOST_INFO, url_encode(temp_hd->host_name), html_encode(temp_hd->host_name, FALSE));
+ found = TRUE;
}
+ last_hd_hostname = temp_hd->host_name;
}
if (found == FALSE)
@@ -528,18 +526,17 @@
for (temp_sd = servicedependency_list; temp_sd != NULL; temp_sd = temp_sd->next) {
- if (!strcmp(temp_sd->dependent_service_description, temp_service->description) && !strcmp(temp_sd->dependent_host_name, temp_host->name)) {
- if (!(!strcmp(temp_sd->service_description, last_sd_svc_desc) && !strcmp(temp_sd->host_name, last_sd_hostname))) {
- if (found == TRUE)
- printf(", ");
-
- printf("<A HREF='%s?type=%d&host=%s", EXTINFO_CGI, DISPLAY_SERVICE_INFO, url_encode(temp_sd->host_name));
- printf("&service=%s'>%s on %s</A>\n", url_encode(temp_sd->service_description), html_encode(temp_sd->service_description, FALSE), html_encode(temp_sd->host_name, FALSE));
- found = TRUE;
- }
- last_sd_svc_desc = temp_sd->service_description;
- last_sd_hostname = temp_sd->host_name;
+ if (!strcmp(temp_sd->dependent_service_description, temp_service->description) && !strcmp(temp_sd->dependent_host_name, temp_host->name) && \
+ !(!strcmp(temp_sd->service_description, last_sd_svc_desc) && !strcmp(temp_sd->host_name, last_sd_hostname))) {
+ if (found == TRUE)
+ printf(", ");
+
+ printf("<A HREF='%s?type=%d&host=%s", EXTINFO_CGI, DISPLAY_SERVICE_INFO, url_encode(temp_sd->host_name));
+ printf("&service=%s'>%s on %s</A>\n", url_encode(temp_sd->service_description), html_encode(temp_sd->service_description, FALSE), html_encode(temp_sd->host_name, FALSE));
+ found = TRUE;
}
+ last_sd_svc_desc = temp_sd->service_description;
+ last_sd_hostname = temp_sd->host_name;
}
if (found == FALSE)
@@ -825,8 +822,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the display type */
else if (!strcmp(variables[x], "type")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/getcgi.c
^
|
@@ -109,27 +109,15 @@
len = strlen(input);
for (x = 0, y = 0; x < len; x++, y++) {
- if (input[x] == '\x0') {
+ if (input[x] == '\x0')
break;
-
- // RB 2013-04-07
- // only allow hex conversion if '%' is follow by a valid character
- } else if (input[x] == '%' && (
- // 0 - 9
- (input[x+1] >= 48 && input[x+1] <= 57) ||
- // A - F
- (input[x+1] >= 65 && input[x+1] <= 70) ||
- // a - f
- (input[x+1] >= 97 && input[x+1] <= 102))
- ) {
-
+ else if (input[x] == '%') {
input[y] = hex_to_char(&input[x+1]);
x += 2;
-
// RB 2011-09-08
// convert plus as well that it can bu used in service and host names
} else if (input[x] == '+') {
- input[y] = ' ';
+ input[y] = ' ';
} else
input[y] = input[x];
}
@@ -169,15 +157,13 @@
/* check for NULL query string environment variable - 04/28/00 (Ludo Bosmans) */
if (getenv("QUERY_STRING") == NULL) {
cgiinput = (char *)malloc(1);
- if (cgiinput != NULL) {
- cgiinput[0] = '\x0';
- }
- } else
- cgiinput = strdup(getenv("QUERY_STRING"));
if (cgiinput == NULL) {
printf("getcgivars(): Could not allocate memory for CGI input.\n");
exit(1);
}
+ cgiinput[0] = '\x0';
+ } else
+ cgiinput = strdup(getenv("QUERY_STRING"));
}
else if (!strcmp(request_method, "POST") || !strcmp(request_method, "PUT")) {
@@ -246,11 +232,7 @@
paircount = 0;
nvpair = strtok(cgiinput, "&");
while (nvpair) {
- pairlist[paircount] = strdup(nvpair);
- if(pairlist[paircount++] == NULL) {
- printf("getcgivars(): Could not allocate memory for name-value pair element #%d.\n", paircount);
- exit(1);
- }
+ pairlist[paircount++] = strdup(nvpair);
if (paircount > MAX_CGI_INPUT_PAIRS)
break;
if (!(paircount % 256)) {
@@ -277,27 +259,12 @@
/* get the variable name preceding the equal (=) sign */
if ((eqpos = strchr(pairlist[i], '=')) != NULL) {
*eqpos = '\0';
- cgivars[i*2+1] = strdup(eqpos + 1);
- if(cgivars[i*2+1] == NULL) {
- printf("getcgivars(): Could not allocate memory for cgi param value #%d.\n", i);
- exit(1);
- }
- unescape_cgi_input(cgivars[i*2+1]);
+ unescape_cgi_input(cgivars[i*2+1] = strdup(eqpos + 1));
} else
- cgivars[i*2+1] = strdup("");
- if(cgivars[i*2+1] == NULL) {
- printf("getcgivars(): Could not allocate memory for empty cgi param value #%d.\n", i);
- exit(1);
- }
- unescape_cgi_input(cgivars[i*2+1]);
+ unescape_cgi_input(cgivars[i*2+1] = strdup(""));
/* get the variable value (or name/value of there was no real "pair" in the first place) */
- cgivars[i*2] = strdup(pairlist[i]);
- if(cgivars[i*2] == NULL) {
- printf("getcgivars(): Could not allocate memory for cgi param name #%d.\n", i);
- exit(1);
- }
- unescape_cgi_input(cgivars[i*2]);
+ unescape_cgi_input(cgivars[i*2] = strdup(pairlist[i]));
}
/* terminate the name-value list */
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/histogram.c
^
|
@@ -901,8 +901,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the host argument */
else if (!strcmp(variables[x], "host")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/history.c
^
|
@@ -899,14 +899,14 @@
else if (display_type == DISPLAY_HOSTS || display_type == DISPLAY_HOSTGROUPS) {
if (history_type == HOST_HISTORY || history_type == SERVICE_HISTORY) {
- snprintf(match1, sizeof(match1), " HOST ALERT: %s;", host_name);
- snprintf(match2, sizeof(match2), " SERVICE ALERT: %s;", host_name);
+ sprintf(match1, " HOST ALERT: %s;", host_name);
+ sprintf(match2, " SERVICE ALERT: %s;", host_name);
} else if (history_type == HOST_FLAPPING_HISTORY || history_type == SERVICE_FLAPPING_HISTORY) {
- snprintf(match1, sizeof(match1), " HOST FLAPPING ALERT: %s;", host_name);
- snprintf(match2, sizeof(match2), " SERVICE FLAPPING ALERT: %s;", host_name);
+ sprintf(match1, " HOST FLAPPING ALERT: %s;", host_name);
+ sprintf(match2, " SERVICE FLAPPING ALERT: %s;", host_name);
} else if (history_type == HOST_DOWNTIME_HISTORY || history_type == SERVICE_DOWNTIME_HISTORY) {
- snprintf(match1, sizeof(match1), " HOST DOWNTIME ALERT: %s;", host_name);
- snprintf(match2, sizeof(match2), " SERVICE DOWNTIME ALERT: %s;", host_name);
+ sprintf(match1, " HOST DOWNTIME ALERT: %s;", host_name);
+ sprintf(match2, " SERVICE DOWNTIME ALERT: %s;", host_name);
}
if (show_all_hosts == TRUE)
@@ -945,11 +945,11 @@
else if (display_type == DISPLAY_SERVICES || display_type == DISPLAY_SERVICEGROUPS) {
if (history_type == SERVICE_HISTORY)
- snprintf(match1, sizeof(match1), " SERVICE ALERT: %s;%s;", host_name, service_desc);
+ sprintf(match1, " SERVICE ALERT: %s;%s;", host_name, service_desc);
else if (history_type == SERVICE_FLAPPING_HISTORY)
- snprintf(match1, sizeof(match1), " SERVICE FLAPPING ALERT: %s;%s;", host_name, service_desc);
+ sprintf(match1, " SERVICE FLAPPING ALERT: %s;%s;", host_name, service_desc);
else if (history_type == SERVICE_DOWNTIME_HISTORY)
- snprintf(match1, sizeof(match1), " SERVICE DOWNTIME ALERT: %s;%s;", host_name, service_desc);
+ sprintf(match1, " SERVICE DOWNTIME ALERT: %s;%s;", host_name, service_desc);
if (display_type == DISPLAY_SERVICEGROUPS)
display_line = TRUE;
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/notifications.c
^
|
@@ -362,8 +362,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the host argument */
else if (!strcmp(variables[x], "host")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/outages.c
^
|
@@ -206,8 +206,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the service severity divisor option */
if (!strcmp(variables[x], "service_divisor")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/readlogs.c
^
|
@@ -382,11 +382,7 @@
/* get timestamp */
temp_buffer = strtok(input, "]");
-
- if (temp_buffer == NULL)
- continue;
-
- timestamp = strtoul(temp_buffer + 1, NULL, 10);
+ timestamp = (temp_buffer == NULL) ? 0L : strtoul(temp_buffer + 1, NULL, 10);
/* skip line if out of range */
if ((ts_end >= 0 && timestamp > ts_end) || (ts_start >= 0 && timestamp < ts_start))
@@ -395,9 +391,6 @@
/* get log entry text */
temp_buffer = strtok(NULL, "\n");
- if (temp_buffer == NULL)
- continue;
-
/* if we search for something, check if it entry matches search_string */
if (search_string != NULL) {
if (regexec(&preg, temp_buffer, 0, NULL, 0) == REG_NOMATCH)
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/status.c
^
|
@@ -1547,8 +1547,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the search_string argument */
else if (!strcmp(variables[x], "search_string")) {
@@ -6936,19 +6938,9 @@
/* get url options but filter out "limit" and "status" */
if (getenv("QUERY_STRING") != NULL && strcmp(getenv("QUERY_STRING"), "")) {
- if(strlen(getenv("QUERY_STRING")) > MAX_INPUT_BUFFER) {
- write_to_cgi_log("status_page_num_selector(): Query string exceeds max length. Returning without displaying page num selector.\n");
- return;
- }
strcpy(stripped_query_string, getenv("QUERY_STRING"));
strip_html_brackets(stripped_query_string);
- /* check if concatenated strings exceed MAX_INPUT_BUFFER */
- if (strlen(link) + strlen(stripped_query_string) + 1 > MAX_INPUT_BUFFER) {
- write_to_cgi_log("status_page_num_selector(): Full query string exceeds max length. Returning without displaying page num selector.\n");
- return;
- }
-
for (temp_buffer = my_strtok(stripped_query_string, "&"); temp_buffer != NULL; temp_buffer = my_strtok(NULL, "&")) {
if (strncmp(temp_buffer, "limit=", 6) != 0 && strncmp(temp_buffer, "start=", 6) != 0) {
if (strstr(link, "?"))
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/statusmap.c
^
|
@@ -313,8 +313,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the host argument */
else if (!strcmp(variables[x], "host")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/summary.c
^
|
@@ -626,8 +626,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found first time argument */
else if (!strcmp(variables[x], "t1")) {
@@ -1186,9 +1188,9 @@
if (temp_entry->type == LOGENTRY_SERVICE_CRITICAL)
state = AE_SERVICE_CRITICAL;
else if (temp_entry->type == LOGENTRY_SERVICE_WARNING)
- state = AE_SERVICE_WARNING;
- else if (temp_entry->type == LOGENTRY_SERVICE_UNKNOWN)
state = AE_SERVICE_UNKNOWN;
+ else if (temp_entry->type == LOGENTRY_SERVICE_UNKNOWN)
+ state = AE_SERVICE_WARNING;
else if (temp_entry->type == LOGENTRY_SERVICE_RECOVERY || temp_entry->type == LOGENTRY_SERVICE_OK)
state = AE_SERVICE_OK;
else
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/cgi/trends.c
^
|
@@ -1117,8 +1117,10 @@
for (x = 0; variables[x] != NULL; x++) {
/* do some basic length checking on the variable identifier to prevent buffer overflows */
- if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
+ if (strlen(variables[x]) >= MAX_INPUT_BUFFER - 1) {
+ x++;
continue;
+ }
/* we found the host argument */
else if (!strcmp(variables[x], "host")) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/common/macros.c
^
|
@@ -200,20 +200,13 @@
/* grab the macro value */
result = grab_macro_value_r(mac, temp_buffer, &selected_macro, &clean_options, &free_macro);
- log_debug_info(DEBUGL_MACROS, 2, " Processed '%s', Clean Options: %d, Free: %d\n, Value: '%s'", temp_buffer, clean_options, free_macro, selected_macro ? selected_macro : "");
+ log_debug_info(DEBUGL_MACROS, 2, " Processed '%s', Clean Options: %d, Free: %d\n", temp_buffer, clean_options, free_macro);
/* an error occurred - we couldn't parse the macro, so continue on */
if (result == ERROR) {
/* empty string still could mean that we hit the escaped $, so log an error in all other cases */
- /* the error tells the user that the macro is valid, but value fetching contained error*/
- if(strcmp(temp_buffer, "")) {
- log_debug_info(DEBUGL_MACROS, 2, " Warning: Error grabbing macro '%s' value '%s'! Maybe used in the wrong scope? Check the docs.\n", temp_buffer, selected_macro ? selected_macro : "" );
-#ifdef NSCORE
- if (keep_unknown_macros == FALSE) {
- logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Error grabbing macro '%s' value '%s'! Maybe used in the wrong scope? Check the docs.\n", temp_buffer, selected_macro ? selected_macro : "" );
- }
-#endif
- }
+ if(strcmp(temp_buffer, ""))
+ logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: An error occurred processing macro '%s'!\n", temp_buffer);
if (free_macro == TRUE)
my_free(selected_macro);
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/common/objects.c
^
|
@@ -64,7 +64,6 @@
module *module_list = NULL, *module_list_tail = NULL;
skiplist *object_skiplists[NUM_OBJECT_SKIPLISTS];
-static int object_skiplists_valid = 0;
#ifdef NSCORE
@@ -107,8 +106,10 @@
/******************************************************************/
int init_object_skiplists(void) {
- if (object_skiplists_valid)
- free_object_skiplists();
+ int x = 0;
+
+ for (x = 0; x < NUM_OBJECT_SKIPLISTS; x++)
+ object_skiplists[x] = NULL;
object_skiplists[HOST_SKIPLIST] = skiplist_new(15, 0.5, FALSE, FALSE, skiplist_compare_host);
object_skiplists[SERVICE_SKIPLIST] = skiplist_new(15, 0.5, FALSE, FALSE, skiplist_compare_service);
@@ -127,8 +128,6 @@
object_skiplists[MODULE_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, skiplist_compare_module);
- object_skiplists_valid = 1;
-
return OK;
}
@@ -140,8 +139,6 @@
for (x = 0; x < NUM_OBJECT_SKIPLISTS; x++)
skiplist_free(&object_skiplists[x]);
- object_skiplists_valid = 0;
-
return OK;
}
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/configure
^
|
@@ -2456,9 +2456,9 @@
PKG_NAME=icinga-core
-PKG_VERSION="1.8.6"
+PKG_VERSION="1.8.2"
PKG_HOME_URL="http://www.icinga.org/"
-PKG_REL_DATE="02-11-2014"
+PKG_REL_DATE="11-28-2012"
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/configure.in
^
|
@@ -9,9 +9,9 @@
AC_PREFIX_DEFAULT(/usr/local/icinga)
PKG_NAME=icinga-core
-PKG_VERSION="1.8.6"
+PKG_VERSION="1.8.2"
PKG_HOME_URL="http://www.icinga.org/"
-PKG_REL_DATE="02-11-2014"
+PKG_REL_DATE="11-28-2012"
dnl Figure out how to invoke "install" and what install options to use.
AC_PROG_INSTALL
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/html/main.html
^
|
@@ -18,9 +18,9 @@
</div>
<div id="currentversioninfo">
-<div class="version">Version 1.8.6</div>
-<div class="releasedate">Februar 11, 2014</div>
-<div class="whatsnew"><a href="docs/en/whatsnew.html">Read what's new in Icinga 1.8.6</a></div>
+<div class="version">Version 1.8.2</div>
+<div class="releasedate">November 28, 2012</div>
+<div class="whatsnew"><a href="docs/en/whatsnew.html">Read what's new in Icinga 1.8.2</a></div>
</div>
<div id="developer">
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/icinga.spec
^
|
@@ -6,7 +6,7 @@
#
# ExclusiveDist: el5 el6
-%define revision 5
+%define revision 1
%define logmsg logger -t %{name}/rpm
@@ -20,13 +20,13 @@
Summary: Open Source host, service and network monitoring program
Name: icinga
-Version: 1.8.6
+Version: 1.8.2
Release: %{revision}%{?dist}
License: GPLv2
Group: Applications/System
URL: http://www.icinga.org/
-Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz
+Source0: http://dl.sf.net/icinga/icinga-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gcc
@@ -64,26 +64,13 @@
%package devel
Summary: Provides include files that Icinga-related applications may compile against
-Group: Development/Libraries
+Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
This package provides include files that Icinga-related applications
may compile against.
-%package idoutils
-Summary: transitional package, use idoutils-libdbi-* instead
-Group: Applications/System
-Requires: %{name} = %{version}-%{release}
-Requires: %{name}-idoutils-libdbi-mysql
-
-%description idoutils
-Transitional package. Idoutils has been splitted into
-idoutils-libdbi-mysql and idoutils-libdbi-pgsql. Use one
-of these. This package pulls in idoutils-libdbi-mysql.
-This package can be safely uninstalled, it provides no
-files and nothing depends on it.
-
%package idoutils-libdbi-mysql
Summary: database broker module for %{name}
Group: Applications/System
@@ -118,14 +105,6 @@
%prep
%setup -qn %{name}-%{version}
-cat << EOF > README.idoutils.transitional
-Transitional package. Idoutils has been splitted into
-idoutils-libdbi-mysql and idoutils-libdbi-pgsql. Use one
-of these. This package pulls in idoutils-libdbi-mysql.
-This package can be safely uninstalled, it provides no
-files and nothing depends on it.
-EOF
-
%build
%configure \
--prefix=%{_datadir}/%{name} \
@@ -243,14 +222,14 @@
# cgi.cfg luckily knows where icinga.cfg is and does not need an update
# retention.dat, objects.cache, objects.precache, status.dat, cmdfile, pidfile, checkresults
%{__perl} -pi -e '
- s|/var/icinga/retention.dat|%{spooldir}/retention.dat|;
- s|/var/icinga/objects.precache|%{spooldir}/objects.precache|;
- s|/var/icinga/objects.cache|%{spooldir}/objects.cache|;
- s|/var/icinga/status.dat|%{spooldir}/status.dat|;
- s|/var/icinga/rw/icinga.cmd|%{spooldir}/cmd/icinga.cmd|;
- s|/var/icinga/icinga.pid|/var/run/icinga.pid|;
+ s|/var/icinga/retention.dat|%{spooldir}/retention.dat|;
+ s|/var/icinga/objects.precache|%{spooldir}/objects.precache|;
+ s|/var/icinga/objects.cache|%{spooldir}/objects.cache|;
+ s|/var/icinga/status.dat|%{spooldir}/status.dat|;
+ s|/var/icinga/rw/icinga.cmd|%{spooldir}/cmd/icinga.cmd|;
+ s|/var/icinga/icinga.pid|/var/run/icinga.pid|;
s|/var/icinga/checkresults|%{spooldir}/checkresults|;
- ' /etc/icinga/icinga.cfg
+ ' /etc/icinga/icinga.cfg
# start icinga
/sbin/service icinga start &>/dev/null || :
@@ -352,8 +331,8 @@
%attr(755,-,-) %{_libdir}/icinga/p1.pl
%{_libdir}/%{name}/eventhandlers
%defattr(-,icinga,icinga,-)
-%dir %{logdir}
-%dir %{logdir}/archives
+%{logdir}
+%{logdir}/archives
%dir %{_localstatedir}/spool/%{name}
%dir %{_localstatedir}/spool/%{name}/checkresults
%attr(2755,icinga,icingacmd) %{_localstatedir}/spool/%{name}/cmd
@@ -403,10 +382,6 @@
%defattr(-,root,root)
%{_includedir}/%{name}/
-%files idoutils
-%defattr(-,root,root)
-%doc README.idoutils.transitional
-
%files idoutils-libdbi-mysql
%defattr(-,root,root,-)
%doc README LICENSE Changelog UPGRADING module/idoutils/db README.RHEL README.RHEL.idoutils
@@ -433,30 +408,6 @@
%changelog
-* Tue Feb 11 2013 Ricardo Bartels <ricardo@bitchbrothers.com> - 1.8.6-1
-- 1.8.6 bump
-
-* Fri Dec 13 2013 Ricardo Bartels <ricardo@bitchbrothers.com> - 1.8.5-1
-- 1.8.5 bump
-
-* Tue Mar 05 2013 Rene Koch <r.koch@ovido.at> - 1.8.4-5
-- fixed double logdir/gui/ definitions in icinga and icinga-gui
-
-* Fri Feb 15 2013 Michael Friedrich <michael.friedrich@netways.de> - 1.8.4-4
-- fix rpmlint errors/warnings
-
-* Wed Feb 06 2013 Michael Friedrich <michael.friedrich@netways.de> - 1.8.4-3
-- add idoutils as transitional package (thx Stefan Marx, Michael Grüner)
-
-* Fri Feb 01 2013 Michael Friedrich <michael.friedrich@netways.de> - 1.8.4-2
-- fix sf.net url
-
-* Sun Jan 13 2013 Michael Friedrich <michael.friedrich@netways.de> - 1.8.4-1
-- 1.8.4 bump
-
-* Wed Dec 12 2012 Michael Friedrich <michael.friedrich@netways.de> - 1.8.3-1
-- 1.8.3 bump
-
* Tue Oct 30 2012 Michael Friedrich <michael.friedrich@gmail.com> - 1.8.2-1
- 1.8.2 bump
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/include/common.h
^
|
@@ -27,8 +27,8 @@
#define PROGRAM_NAME "Icinga"
#define PROGRAM_NAME_UC "ICINGA"
#define PROGRAM_NAME_LC "icinga"
-#define PROGRAM_VERSION "1.8.6"
-#define PROGRAM_MODIFICATION_DATE "02-11-2014"
+#define PROGRAM_VERSION "1.8.2"
+#define PROGRAM_MODIFICATION_DATE "11-28-2012"
/*#define DEBUG_CHECK_IPC 1 */
/*#define DEBUG_CHECK_IPC2 1*/
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/module/idoutils/include/common.h
^
|
@@ -22,8 +22,8 @@
#define LOG2IDO_NAME "LOG2IDO"
/* only one space for update-version matching */
-#define IDO_DATE "02-11-2014"
-#define IDO_VERSION "1.8.6"
+#define IDO_DATE "11-28-2012"
+#define IDO_VERSION "1.8.2"
#define IDO_SCHEMA_VERSION "1.8.0"
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/module/idoutils/include/idomod.h
^
|
@@ -14,8 +14,7 @@
/* this is needed for access to daemon's internal data */
#define NSCORE 1
-#define IDOMOD_MAX_BUFLEN 49152
-#define IDOMOD_MAX_TEXT_LEN 32768
+#define IDOMOD_MAX_BUFLEN 49152
/************** structures *******************/
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/module/idoutils/src/dbqueries.c
^
|
@@ -633,11 +633,9 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[11] != NULL) {
- if (strlen(*(char **) data[11]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[11])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_systemcommanddata_add() Warning:long_output truncated\n");
- }
+ if (strlen(*(char **) data[11]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[11])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_systemcommanddata_add() Warning:long_output truncated\n");
}
dummy = asprintf(&query1, "UPDATE %s SET end_time=%s, end_time_usec=%lu, command_line='%s', timeout=%d, early_timeout=%d, execution_time=%lf, return_code=%d, output='%s', long_output='%s' WHERE instance_id=%lu AND start_time=%s AND start_time_usec=%lu",
@@ -906,11 +904,9 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[17] != NULL) {
- if (strlen(*(char **) data[17]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[17])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_eventhandlerdata_add() Warning:long_output truncated\n");
- }
+ if (strlen(*(char **) data[17]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[17])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_eventhandlerdata_add() Warning:long_output truncated\n");
}
dummy = asprintf(&query1, "UPDATE %s SET eventhandler_type=%d, object_id=%lu, state=%d, state_type=%d, end_time=%s, end_time_usec=%lu, command_object_id=%lu, command_args='%s', command_line='%s', timeout=%d, early_timeout=%d, execution_time=%lf, return_code=%d, output='%s', long_output='%s' WHERE instance_id=%lu AND start_time=%s AND start_time_usec=%lu",
@@ -1231,11 +1227,9 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[10] != NULL) {
- if (strlen(*(char **) data[10]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[10])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_notificationdata_add() Warning:long_output truncated\n");
- }
+ if (strlen(*(char **) data[10]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[10])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_notificationdata_add() Warning:long_output truncated\n");
}
dummy = asprintf(&query1, "UPDATE %s SET notification_type=%d, notification_reason=%d, end_time=%s, end_time_usec=%lu, state=%d, output='%s', long_output='%s', escalated=%d, contacts_notified=%d WHERE instance_id=%lu AND start_time=%s AND start_time_usec=%lu AND object_id=%lu",
@@ -2087,19 +2081,15 @@
#ifdef USE_LIBDBI /* everything else will be libdbi */
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
- /* truncate long_output #2342 */
- if (*(char **) data[17] != NULL) {
- if (strlen(*(char **) data[17]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[17])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_servicecheckdata_add() Warning:long_output truncated\n");
- }
- }
- if (*(char **) data[18] != NULL) {
- if (strlen(*(char **) data[18]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[18])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_servicecheckdata_add() Warning:perfdata truncated\n");
- }
- }
+ /* truncate long_output #2342 */
+ if (strlen(*(char **) data[17]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[17])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_servicecheckdata_add() Warning:long_output truncated\n");
+ }
+ if (strlen(*(char **) data[18]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[18])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_servicecheckdata_add() Warning:perfdata truncated\n");
+ }
dummy = asprintf(&query1,
"INSERT INTO %s (instance_id, service_object_id, check_type, "
"current_check_attempt, max_check_attempts, state, state_type, "
@@ -2342,18 +2332,14 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[21] != NULL) {
- if (strlen(*(char **) data[21]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[21])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_hostcheckdata_add() Warning:long_output truncated\n");
- }
- }
- if (*(char **) data[22] != NULL) {
- if (strlen(*(char **) data[22]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[22])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_hostcheckdata_add() Warning:perfdata truncated\n");
- }
- }
+ if (strlen(*(char **) data[21]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[21])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_hostcheckdata_add() Warning:long_output truncated\n");
+ }
+ if (strlen(*(char **) data[22]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[22])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_hostcheckdata_add() Warning:perfdata truncated\n");
+ }
dummy = asprintf(&query1, "INSERT INTO %s (command_object_id, command_args, command_line, "
"instance_id, host_object_id, check_type, is_raw_check, current_check_attempt, "
"max_check_attempts, state, state_type, start_time, start_time_usec, end_time, "
@@ -3972,17 +3958,13 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[4] != NULL) {
- if (strlen(*(char **) data[4]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[4])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_hoststatusdata_add() Warning:long_output truncated\n");
- }
- }
- if (*(char **) data[5] != NULL) {
- if (strlen(*(char **) data[5]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[5])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_hoststatusdata_add() Warning:perfdata truncated\n");
- }
+ if (strlen(*(char **) data[4]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[4])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_hoststatusdata_add() Warning:long_output truncated\n");
+ }
+ if (strlen(*(char **) data[5]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[5])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_hoststatusdata_add() Warning:perfdata truncated\n");
}
dummy = asprintf(&query1, "UPDATE %s SET instance_id=%lu, host_object_id=%lu, status_update_time=%s, output='%s', long_output='%s', perfdata='%s', current_state=%d, has_been_checked=%d, should_be_scheduled=%d, current_check_attempt=%d, max_check_attempts=%d, last_check=%s, next_check=%s, check_type=%d, last_state_change=%s, last_hard_state_change=%s, last_hard_state=%d, last_time_up=%s, last_time_down=%s, last_time_unreachable=%s, state_type=%d, last_notification=%s, next_notification=%s, no_more_notifications=%d, notifications_enabled=%d, problem_has_been_acknowledged=%d, acknowledgement_type=%d, current_notification_number=%d, passive_checks_enabled=%d, active_checks_enabled=%d, event_handler_enabled=%d, flap_detection_enabled=%d, is_flapping=%d, percent_state_change='%lf', latency='%lf', execution_time='%lf', scheduled_downtime_depth=%d, failure_prediction_enabled=%d, process_performance_data=%d, obsess_over_host=%d, modified_host_attributes=%lu, event_handler='%s', check_command='%s', normal_check_interval='%lf', retry_check_interval='%lf', check_timeperiod_object_id=%lu WHERE host_object_id=%lu",
ido2db_db_tablenames[IDO2DB_DBTABLE_HOSTSTATUS],
@@ -4492,17 +4474,13 @@
switch (idi->dbinfo.server_type) {
case IDO2DB_DBSERVER_MYSQL:
/* truncate long_output #2342 */
- if (*(char **) data[4] != NULL) {
- if (strlen(*(char **) data[4]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[4])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_servicestatusdata_add() Warning:long_output truncated\n");
- }
- }
- if (*(char **) data[5] != NULL) {
- if (strlen(*(char **) data[5]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
- (*(char **) data[5])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
- ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_servicestatusdata_add() Warning:perfdata truncated\n");
- }
+ if (strlen(*(char **) data[4]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[4])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_servicestatusdata_add() Warning:long_output truncated\n");
+ }
+ if (strlen(*(char **) data[5]) > IDO2DB_MYSQL_MAX_TEXT_LEN ) {
+ (*(char **) data[5])[IDO2DB_MYSQL_MAX_TEXT_LEN]=0;
+ ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_servicestatusdata_add() Warning:perfdata truncated\n");
}
dummy = asprintf(&query1, "UPDATE %s SET instance_id=%lu, service_object_id=%lu, status_update_time=%s, output='%s', long_output='%s', perfdata='%s', current_state=%d, has_been_checked=%d, should_be_scheduled=%d, current_check_attempt=%d, max_check_attempts=%d, last_check=%s, next_check=%s, check_type=%d, last_state_change=%s, last_hard_state_change=%s, last_hard_state=%d, last_time_ok=%s, last_time_warning=%s, last_time_unknown=%s, last_time_critical=%s, state_type=%d, last_notification=%s, next_notification=%s, no_more_notifications=%d, notifications_enabled=%d, problem_has_been_acknowledged=%d, acknowledgement_type=%d, current_notification_number=%d, passive_checks_enabled=%d, active_checks_enabled=%d, event_handler_enabled=%d, flap_detection_enabled=%d, is_flapping=%d, percent_state_change='%lf', latency='%lf', execution_time='%lf', scheduled_downtime_depth=%d, failure_prediction_enabled=%d, process_performance_data=%d, obsess_over_service=%d, modified_service_attributes=%lu, event_handler='%s', check_command='%s', normal_check_interval='%lf', retry_check_interval='%lf', check_timeperiod_object_id=%lu WHERE service_object_id=%lu",
ido2db_db_tablenames[IDO2DB_DBTABLE_SERVICESTATUS],
@@ -5259,12 +5237,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "configfile_id");
+ configfile_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "configfile_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -5749,12 +5722,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "host_id");
+ host_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "host_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -6721,12 +6689,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "hostgroup_id");
+ hostgroup_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "hostgroup_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -7176,12 +7139,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "service_id");
+ service_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "service_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -7937,12 +7895,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "servicegroup_id");
+ servicegroup_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "servicegroup_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -8801,12 +8754,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "hostescalation_id");
+ hostescalation_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "hostescalation_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -9426,12 +9374,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "serviceescalation_id");
+ serviceescalation_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "serviceescalation_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -10229,12 +10172,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "timeperiod_id");
+ timeperiod_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "timeperiod_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -10675,12 +10613,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contact_id");
+ contact_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contact_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -11012,7 +10945,7 @@
char * query = NULL;
char * query1 = NULL;
char * query2 = NULL;
- unsigned long contact_address_id;
+ unsigned long contactaddress_id;
int mysql_update = FALSE;
#endif
ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_query_insert_or_update_contactdefinition_addresses_add() start\n");
@@ -11043,7 +10976,7 @@
idi->dbinfo.dbi_result = NULL;
- dummy = asprintf(&query, "SELECT contact_address_id FROM %s WHERE contact_id=%lu AND address_number=%d",
+ dummy = asprintf(&query, "SELECT contactaddress_id FROM %s WHERE contact_id=%lu AND address_number=%d",
ido2db_db_tablenames[IDO2DB_DBTABLE_CONTACTADDRESSES],
*(unsigned long *) data[1], /* unique constraint start */
*(int *) data[2] /* unique constraint end */
@@ -11053,7 +10986,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- contact_address_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contact_address_id");
+ contactaddress_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contactaddress_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
@@ -11967,12 +11900,7 @@
if ((result = ido2db_db_query(idi, query)) == IDO_OK) {
if (idi->dbinfo.dbi_result != NULL) {
if (dbi_result_next_row(idi->dbinfo.dbi_result)) {
- /* this condition should never happen, as libdbi UPDATE and affected rows
- * should take care of it. it seems that newer mysql versions got problems
- * with libdbi (https://dev.icinga.org/issues/3728) so we return the selected id
- * as fallback here
- */
- *id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contactgroup_id");
+ contactgroup_id = dbi_result_get_ulonglong(idi->dbinfo.dbi_result, "contactgroup_id");
mysql_update = TRUE;
} else {
mysql_update = FALSE;
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/module/idoutils/src/ido2db.c
^
|
@@ -297,10 +297,6 @@
/* open debug log */
ido2db_open_debug_log();
- /* unlink leftover socket */
- if (ido2db_socket_type == IDO_SINK_UNIXSOCKET)
- unlink(ido2db_socket_name);
-
/* if we're running under inetd... */
if (ido2db_use_inetd == IDO_TRUE) {
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/module/idoutils/src/idomod.c
^
|
@@ -65,8 +65,6 @@
int idomod_open_debug_log(void);
int idomod_close_debug_log(void);
-static char *broker_data_temp_buffer;
-
extern int errno;
/**** Icinga VARIABLES ****/
@@ -244,8 +242,6 @@
/* save unprocessed data to buffer file */
idomod_save_unprocessed_data(idomod_buffer_file);
- free(idomod_buffer_file);
- idomod_buffer_file = NULL;
/* clear sink buffer */
idomod_sink_buffer_deinit(&sinkbuf);
@@ -259,20 +255,6 @@
/* close debug log */
idomod_close_debug_log();
- /* free variables */
- free(idomod_instance_name);
- idomod_instance_name = NULL;
-
- free(idomod_sink_name);
- idomod_sink_name = NULL;
-
- free(idomod_sink_rotation_command);
- idomod_sink_rotation_command = NULL;
-
- /* free temp buffer */
- free(broker_data_temp_buffer);
- broker_data_temp_buffer = NULL;
-
return IDO_OK;
}
@@ -1256,7 +1238,7 @@
/* handles brokered event data */
int idomod_broker_data(int event_type, void *data) {
//char temp_buffer[IDOMOD_MAX_BUFLEN];
- char *temp_buffer;
+ static char *temp_buffer;
ido_dbuf dbuf;
int write_to_sink = IDO_TRUE;
host *temp_host = NULL;
@@ -1298,14 +1280,12 @@
int last_state = -1;
int last_hard_state = -1;
- if (broker_data_temp_buffer == NULL) {
- broker_data_temp_buffer = (char *)malloc(IDOMOD_MAX_BUFLEN);
- if (broker_data_temp_buffer == NULL)
+ if (temp_buffer == NULL) {
+ temp_buffer = (char *)malloc(IDOMOD_MAX_BUFLEN);
+ if (temp_buffer == NULL)
return 0;
}
- temp_buffer = broker_data_temp_buffer;
-
idomod_log_debug_info(IDOMOD_DEBUGL_PROCESSINFO, 2, "idomod_broker_data() start\n");
@@ -1820,18 +1800,6 @@
es[6] = ido_escape_buffer(scdata->long_output);
es[7] = ido_escape_buffer(scdata->perf_data);
- if(es[6] != NULL) {
- if(strlen(es[6]) > IDOMOD_MAX_TEXT_LEN) {
- es[6][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
- if(es[7] != NULL) {
- if(strlen(es[7]) > IDOMOD_MAX_TEXT_LEN) {
- es[7][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
, "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
, IDO_API_SERVICECHECKDATA
@@ -1910,18 +1878,6 @@
es[5] = ido_escape_buffer(hcdata->long_output);
es[6] = ido_escape_buffer(hcdata->perf_data);
- if(es[5] != NULL) {
- if(strlen(es[5]) > IDOMOD_MAX_TEXT_LEN) {
- es[5][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
- if(es[6] != NULL) {
- if(strlen(es[6]) > IDOMOD_MAX_TEXT_LEN) {
- es[6][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
, "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
, IDO_API_HOSTCHECKDATA
@@ -2226,18 +2182,6 @@
es[5] = ido_escape_buffer(temp_host->host_check_command);
es[6] = ido_escape_buffer(temp_host->check_period);
- if(es[2] != NULL) {
- if(strlen(es[2]) > IDOMOD_MAX_TEXT_LEN) {
- es[2][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
- if(es[3] != NULL) {
- if(strlen(es[3]) > IDOMOD_MAX_TEXT_LEN) {
- es[3][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
retry_interval = temp_host->retry_interval;
snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
@@ -2397,18 +2341,6 @@
es[6] = ido_escape_buffer(temp_service->service_check_command);
es[7] = ido_escape_buffer(temp_service->check_period);
- if(es[3] != NULL) {
- if(strlen(es[3]) > IDOMOD_MAX_TEXT_LEN) {
- es[3][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
- if(es[4] != NULL) {
- if(strlen(es[4]) > IDOMOD_MAX_TEXT_LEN) {
- es[4][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
, "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%s\n"
, IDO_API_SERVICESTATUSDATA
@@ -3110,12 +3042,6 @@
es[2] = ido_escape_buffer(schangedata->output);
es[3] = ido_escape_buffer(schangedata->long_output);
- if(es[3] != NULL) {
- if(strlen(es[3]) > IDOMOD_MAX_TEXT_LEN) {
- es[3][IDOMOD_MAX_TEXT_LEN] = '\0';
- }
- }
-
snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
, "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
, IDO_API_STATECHANGEDATA
@@ -3341,6 +3267,10 @@
/* initialize dynamic buffer (2KB chunk size) */
ido_dbuf_init(&dbuf, 2048);
+ /* initialize buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++)
+ es[x] = NULL;
+
/****** dump command config ******/
for (temp_command = command_list; temp_command != NULL; temp_command = temp_command->next) {
@@ -3363,9 +3293,12 @@
/* write data to sink */
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
idomod_write_to_sink(temp_buffer, IDO_TRUE, IDO_TRUE);
+ }
- free(es[0]);
- free(es[1]);
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
}
/****** dump timeperiod config ******/
@@ -3388,9 +3321,6 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
-
/* dump timeranges for each day */
for (x = 0; x < 7; x++) {
for (temp_timerange = temp_timeperiod->days[x]; temp_timerange != NULL; temp_timerange = temp_timerange->next) {
@@ -3420,6 +3350,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump contact config ******/
for (temp_contact = contact_list; temp_contact != NULL; temp_contact = temp_contact->next) {
@@ -3487,11 +3423,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
- free(es[1]);
- free(es[2]);
- free(es[3]);
- free(es[4]);
- free(es[5]);
+ es[0] = NULL;
/* dump addresses for each contact */
for (x = 0; x < MAX_CONTACT_ADDRESSES; x++) {
@@ -3508,6 +3440,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump host notification commands for each contact */
@@ -3524,6 +3457,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump service notification commands for each contact */
@@ -3540,6 +3474,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump customvars */
@@ -3558,8 +3493,10 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
+ for (x = 0; x < 2; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -3575,6 +3512,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump contactgroup config ******/
for (temp_contactgroup = contactgroup_list; temp_contactgroup != NULL; temp_contactgroup = temp_contactgroup->next) {
@@ -3596,7 +3539,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
- free(es[1]);
+ es[0] = NULL;
/* dump members for each contactgroup */
for (temp_contactsmember = temp_contactgroup->members; temp_contactsmember != NULL; temp_contactsmember = temp_contactsmember->next) {
@@ -3612,6 +3555,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -3627,6 +3571,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump host config ******/
for (temp_host = host_list; temp_host != NULL; temp_host = temp_host->next) {
@@ -3781,8 +3731,8 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- for (x = 0; x < 16; x++)
- free(es[x]);
+ free(es[0]);
+ es[0] = NULL;
/* dump parent hosts */
for (temp_hostsmember = temp_host->parent_hosts; temp_hostsmember != NULL; temp_hostsmember = temp_hostsmember->next) {
@@ -3798,6 +3748,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump contactgroups */
@@ -3814,6 +3765,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump individual contacts */
@@ -3830,6 +3782,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
@@ -3849,8 +3802,10 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
+ for (x = 0; x < 2; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -3866,6 +3821,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump hostgroup config ******/
for (temp_hostgroup = hostgroup_list; temp_hostgroup != NULL; temp_hostgroup = temp_hostgroup->next) {
@@ -3887,7 +3848,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
- free(es[1]);
+ es[0] = NULL;
/* dump members for each hostgroup */
for (temp_hostsmember = temp_hostgroup->members; temp_hostsmember != NULL; temp_hostsmember = temp_hostsmember->next) {
@@ -3903,6 +3864,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -3918,6 +3880,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump service config ******/
for (temp_service = service_list; temp_service != NULL; temp_service = temp_service->next) {
@@ -4046,8 +4014,8 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- for (x = 0; x < 13; x++)
- free(es[x]);
+ free(es[0]);
+ es[0] = NULL;
/* dump contactgroups */
for (temp_contactgroupsmember = temp_service->contact_groups; temp_contactgroupsmember != NULL; temp_contactgroupsmember = temp_contactgroupsmember->next) {
@@ -4063,6 +4031,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump individual contacts */
@@ -4079,6 +4048,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump customvars */
@@ -4097,8 +4067,10 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
+ for (x = 0; x < 2; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -4114,6 +4086,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump servicegroup config ******/
for (temp_servicegroup = servicegroup_list; temp_servicegroup != NULL; temp_servicegroup = temp_servicegroup->next) {
@@ -4136,6 +4114,8 @@
free(es[0]);
free(es[1]);
+ es[0] = NULL;
+ es[1] = NULL;
/* dump members for each servicegroup */
for (temp_servicesmember = temp_servicegroup->members; temp_servicesmember != NULL; temp_servicesmember = temp_servicesmember->next) {
@@ -4154,6 +4134,8 @@
free(es[0]);
free(es[1]);
+ es[0] = NULL;
+ es[1] = NULL;
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -4169,6 +4151,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump host escalation config ******/
for (temp_hostescalation = hostescalation_list; temp_hostescalation != NULL; temp_hostescalation = temp_hostescalation->next) {
@@ -4202,7 +4190,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
- free(es[1]);
+ es[0] = NULL;
/* dump contactgroups */
for (temp_contactgroupsmember = temp_hostescalation->contact_groups; temp_contactgroupsmember != NULL; temp_contactgroupsmember = temp_contactgroupsmember->next) {
@@ -4218,6 +4206,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump individual contacts */
@@ -4234,6 +4223,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -4249,6 +4239,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump service escalation config ******/
for (temp_serviceescalation = serviceescalation_list; temp_serviceescalation != NULL; temp_serviceescalation = temp_serviceescalation->next) {
@@ -4287,8 +4283,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
- free(es[1]);
- free(es[2]);
+ es[0] = NULL;
/* dump contactgroups */
for (temp_contactgroupsmember = temp_serviceescalation->contact_groups; temp_contactgroupsmember != NULL; temp_contactgroupsmember = temp_contactgroupsmember->next) {
@@ -4304,6 +4299,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
/* dump individual contacts */
@@ -4320,6 +4316,7 @@
ido_dbuf_strcat(&dbuf, temp_buffer);
free(es[0]);
+ es[0] = NULL;
}
snprintf(temp_buffer, sizeof(temp_buffer) - 1
@@ -4335,6 +4332,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump host dependency config ******/
for (temp_hostdependency = hostdependency_list; temp_hostdependency != NULL; temp_hostdependency = temp_hostdependency->next) {
@@ -4369,10 +4372,6 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
- free(es[2]);
-
snprintf(temp_buffer, sizeof(temp_buffer) - 1
, "%d\n\n"
, IDO_API_ENDDATA
@@ -4386,6 +4385,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
/****** dump service dependency config ******/
for (temp_servicedependency = servicedependency_list; temp_servicedependency != NULL; temp_servicedependency = temp_servicedependency->next) {
@@ -4428,12 +4433,6 @@
temp_buffer[sizeof(temp_buffer)-1] = '\x0';
ido_dbuf_strcat(&dbuf, temp_buffer);
- free(es[0]);
- free(es[1]);
- free(es[2]);
- free(es[3]);
- free(es[4]);
-
snprintf(temp_buffer, sizeof(temp_buffer) - 1
, "%d\n\n"
, IDO_API_ENDDATA
@@ -4447,6 +4446,12 @@
}
+ /* free buffers */
+ for (x = 0; x < OBJECTCONFIG_ES_ITEMS; x++) {
+ free(es[x]);
+ es[x] = NULL;
+ }
+
idomod_log_debug_info(IDOMOD_DEBUGL_PROCESSINFO, 2, "idomod_write_object_config() end\n");
return IDO_OK;
@@ -4727,9 +4732,6 @@
if (idomod_debug_file_fp != NULL)
fclose(idomod_debug_file_fp);
- free(idomod_debug_file);
- idomod_debug_file = NULL;
-
idomod_debug_file_fp = NULL;
return IDO_OK;
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/rc.ido2db.in
^
|
@@ -14,7 +14,7 @@
# Description: Icinga Data Out Daemon
### END INIT INFO
-# chkconfig: 345 98 01
+# chkconfig: 345 99 01
#
# File : ido2db
#
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/update-version
^
|
@@ -10,10 +10,10 @@
fi
# Current version number
-CURRENTVERSION=1.8.6
+CURRENTVERSION=1.8.2
# Last date
-LASTDATE=02-11-2014
+LASTDATE=11-28-2012
if [ "x$1" = "x" ]
then
|
[-]
[+]
|
Changed |
icinga-1.8.2.tar.bz2/xdata/xodtemplate.c
^
|
@@ -1128,12 +1128,13 @@
xod_begin_def(hostescalation);
new_hostescalation->first_notification = -2;
new_hostescalation->last_notification = -2;
- /* state based escalation ranges */
+#ifdef USE_ST_BASED_ESCAL_RANGE
new_hostescalation->first_down_notification = -2;
new_hostescalation->last_down_notification = -2;
new_hostescalation->first_unreachable_notification = -2;
new_hostescalation->last_unreachable_notification = -2;
new_hostescalation->notification_interval = -2.0;
+#endif
break;
case XODTEMPLATE_HOSTEXTINFO:
|