[icinga-checkins] icinga.org: icinga-core/cmaser/fixes: fix for retaining host display name and alias, as well as service display name (Folkert van Heusden)

git at icinga.org git at icinga.org
Fri Sep 3 11:28:54 CEST 2010


Module: icinga-core
Branch: cmaser/fixes
Commit: e3e7e88e73fdffeb06b5feed2801505138e7c0f7
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=e3e7e88e73fdffeb06b5feed2801505138e7c0f7

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Sep  1 18:32:19 2010 +0200

fix for retaining host display name and alias, as well as service display name (Folkert van Heusden)

refs #760

---

 Changelog          |    1 +
 THANKS             |    1 +
 xdata/xrddefault.c |   15 +++++++++++++++
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/Changelog b/Changelog
index 24072f9..1ae0a48 100644
--- a/Changelog
+++ b/Changelog
@@ -20,6 +20,7 @@ FIXES
 * core: fix segfault in escalation conditions when using object tricks (Vitali Voroth)
 * core: fix for event execution loop re-scheduling host checks instead of executing them if service checks are disabled (Ethan Galstad)
 * core: fix custom macros being cleaned/stripped (as they are user-defined and should be trusted) (Peter Morch)
+* core: fix for retaining host display name and alias, as well as service display name (Folkert van Heusden)
 
 * classic ui: update jquery for multiple cmds dropdown, resolve conflicts with pnp
 * classic ui: fix delay sorting of comments/downtimes (Ton Voon)
diff --git a/THANKS b/THANKS
index 97ed7a3..4a1a901 100644
--- a/THANKS
+++ b/THANKS
@@ -279,6 +279,7 @@ in various ways.  If we missed your name, let us know.
 * Steve Underwood
 * Kai Ung
 * Stephane Urbanovski
+* Folkert Van Heusden
 * Franky Van Liedekerke
 * Nikola Vassilev
 * Esteban Manchado Velazquez
diff --git a/xdata/xrddefault.c b/xdata/xrddefault.c
index 0b728bc..1b80bb0 100644
--- a/xdata/xrddefault.c
+++ b/xdata/xrddefault.c
@@ -360,6 +360,8 @@ int xrddefault_save_state_information(void){
 
 		fprintf(fp,"host {\n");
 		fprintf(fp,"host_name=%s\n",temp_host->name);
+		fprintf(fp,"alias=%s\n",temp_host->alias);
+		fprintf(fp,"display_name=%s\n",temp_host->display_name);
 		fprintf(fp,"modified_attributes=%lu\n",(temp_host->modified_attributes & ~host_attribute_mask));
 		fprintf(fp,"check_command=%s\n",(temp_host->host_check_command==NULL)?"":temp_host->host_check_command);
 		fprintf(fp,"check_period=%s\n",(temp_host->check_period==NULL)?"":temp_host->check_period);
@@ -434,6 +436,7 @@ int xrddefault_save_state_information(void){
 
 		fprintf(fp,"service {\n");
 		fprintf(fp,"host_name=%s\n",temp_service->host_name);
+		fprintf(fp,"display_name=%s\n",temp_service->display_name);
 		fprintf(fp,"service_description=%s\n",temp_service->description);
 		fprintf(fp,"modified_attributes=%lu\n",(temp_service->modified_attributes & ~service_attribute_mask));
 		fprintf(fp,"check_command=%s\n",(temp_service->service_check_command==NULL)?"":temp_service->service_check_command);
@@ -1250,6 +1253,14 @@ int xrddefault_read_retention_file_information(char *retention_file, int overwri
 							temp_host->last_state=atoi(val);
 						else if(!strcmp(var,"last_hard_state"))
 							temp_host->last_hard_state=atoi(val);
+						else if(!strcmp(var,"alias")){
+							my_free(temp_host->alias);
+							temp_host->alias=(char *)strdup(val);
+							}
+						else if(!strcmp(var,"display_name")){
+							my_free(temp_host->display_name);
+							temp_host->display_name=(char *)strdup(val);
+							}
 						else if(!strcmp(var,"plugin_output")){
 							my_free(temp_host->plugin_output);
 							temp_host->plugin_output=(char *)strdup(val);
@@ -1532,6 +1543,10 @@ int xrddefault_read_retention_file_information(char *retention_file, int overwri
 							temp_service->last_state=atoi(val);
 						else if(!strcmp(var,"last_hard_state"))
 							temp_service->last_hard_state=atoi(val);
+						else if(!strcmp(var,"display_name")){
+							my_free(temp_service->display_name);
+							temp_service->display_name=(char *)strdup(val);
+							}
 						else if(!strcmp(var,"current_attempt"))
 							temp_service->current_attempt=atoi(val);
 						else if(!strcmp(var,"current_event_id"))





More information about the icinga-checkins mailing list