From: Ethan G. <ega...@us...> - 2003-06-18 00:45:38
|
Update of /cvsroot/nagios/nagios/xdata In directory sc8-pr-cvs1:/tmp/cvs-serv20383/xdata Modified Files: xodtemplate.c xodtemplate.h xrddefault.c Log Message: Added action_url directive Index: xodtemplate.c =================================================================== RCS file: /cvsroot/nagios/nagios/xdata/xodtemplate.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** xodtemplate.c 14 Jun 2003 04:51:06 -0000 1.55 --- xodtemplate.c 18 Jun 2003 00:45:33 -0000 1.56 *************** *** 4,8 **** * * Copyright (c) 2001-2003 Ethan Galstad (na...@na...) ! * Last Modified: 06-13-2003 * * Description: --- 4,8 ---- * * Copyright (c) 2001-2003 Ethan Galstad (na...@na...) ! * Last Modified: 06-17-2003 * * Description: *************** *** 1270,1273 **** --- 1270,1274 ---- new_hostextinfo->notes=NULL; new_hostextinfo->notes_url=NULL; + new_hostextinfo->action_url=NULL; new_hostextinfo->icon_image=NULL; new_hostextinfo->icon_image_alt=NULL; *************** *** 1312,1315 **** --- 1313,1317 ---- new_serviceextinfo->notes=NULL; new_serviceextinfo->notes_url=NULL; + new_serviceextinfo->action_url=NULL; new_serviceextinfo->icon_image=NULL; new_serviceextinfo->icon_image_alt=NULL; *************** *** 3111,3114 **** --- 3113,3125 ---- } } + else if(!strcmp(variable,"action_url")){ + temp_hostextinfo->action_url=strdup(value); + if(temp_hostextinfo->action_url==NULL){ + #ifdef DEBUG1 + printf("Error: Could not allocate memory for extended host info action_url.\n"); + #endif + return ERROR; + } + } else if(!strcmp(variable,"icon_image")){ temp_hostextinfo->icon_image=strdup(value); *************** *** 3283,3286 **** --- 3294,3306 ---- } } + else if(!strcmp(variable,"action_url")){ + temp_serviceextinfo->action_url=strdup(value); + if(temp_serviceextinfo->action_url==NULL){ + #ifdef DEBUG1 + printf("Error: Could not allocate memory for extended service info action_url.\n"); + #endif + return ERROR; + } + } else if(!strcmp(variable,"icon_image")){ temp_serviceextinfo->icon_image=strdup(value); *************** *** 4801,4804 **** --- 4821,4825 ---- new_hostextinfo->notes=NULL; new_hostextinfo->notes_url=NULL; + new_hostextinfo->action_url=NULL; new_hostextinfo->icon_image=NULL; new_hostextinfo->icon_image_alt=NULL; *************** *** 4817,4820 **** --- 4838,4843 ---- if(this_hostextinfo->notes_url!=NULL) new_hostextinfo->notes_url=strdup(this_hostextinfo->notes_url); + if(this_hostextinfo->action_url!=NULL) + new_hostextinfo->action_url=strdup(this_hostextinfo->action_url); if(this_hostextinfo->icon_image!=NULL) new_hostextinfo->icon_image=strdup(this_hostextinfo->icon_image); *************** *** 4873,4876 **** --- 4896,4900 ---- new_serviceextinfo->notes=NULL; new_serviceextinfo->notes_url=NULL; + new_serviceextinfo->action_url=NULL; new_serviceextinfo->icon_image=NULL; new_serviceextinfo->icon_image_alt=NULL; *************** *** 4892,4895 **** --- 4916,4921 ---- if(this_serviceextinfo->notes_url!=NULL) new_serviceextinfo->notes_url=strdup(this_serviceextinfo->notes_url); + if(this_serviceextinfo->action_url!=NULL) + new_serviceextinfo->action_url=strdup(this_serviceextinfo->action_url); if(this_serviceextinfo->icon_image!=NULL) new_serviceextinfo->icon_image=strdup(this_serviceextinfo->icon_image); *************** *** 6025,6028 **** --- 6051,6056 ---- if(this_hostextinfo->notes_url==NULL && template_hostextinfo->notes_url!=NULL) this_hostextinfo->notes_url=strdup(template_hostextinfo->notes_url); + if(this_hostextinfo->action_url==NULL && template_hostextinfo->action_url!=NULL) + this_hostextinfo->action_url=strdup(template_hostextinfo->action_url); if(this_hostextinfo->icon_image==NULL && template_hostextinfo->icon_image!=NULL) this_hostextinfo->icon_image=strdup(template_hostextinfo->icon_image); *************** *** 6102,6105 **** --- 6130,6135 ---- if(this_serviceextinfo->notes_url==NULL && template_serviceextinfo->notes_url!=NULL) this_serviceextinfo->notes_url=strdup(template_serviceextinfo->notes_url); + if(this_serviceextinfo->action_url==NULL && template_serviceextinfo->action_url!=NULL) + this_serviceextinfo->action_url=strdup(template_serviceextinfo->action_url); if(this_serviceextinfo->icon_image==NULL && template_serviceextinfo->icon_image!=NULL) this_serviceextinfo->icon_image=strdup(template_serviceextinfo->icon_image); *************** *** 7690,7694 **** /* register the extended host object */ ! new_hostextinfo=add_hostextinfo(this_hostextinfo->host_name,this_hostextinfo->notes,this_hostextinfo->notes_url,this_hostextinfo->icon_image,this_hostextinfo->vrml_image,this_hostextinfo->statusmap_image,this_hostextinfo->icon_image_alt,this_hostextinfo->x_2d,this_hostextinfo->y_2d,this_hostextinfo->x_3d,this_hostextinfo->y_3d,this_hostextinfo->z_3d,this_hostextinfo->have_2d_coords,this_hostextinfo->have_3d_coords); /* return with an error if we couldn't add the definition */ --- 7720,7724 ---- /* register the extended host object */ ! new_hostextinfo=add_hostextinfo(this_hostextinfo->host_name,this_hostextinfo->notes,this_hostextinfo->notes_url,this_hostextinfo->action_url,this_hostextinfo->icon_image,this_hostextinfo->vrml_image,this_hostextinfo->statusmap_image,this_hostextinfo->icon_image_alt,this_hostextinfo->x_2d,this_hostextinfo->y_2d,this_hostextinfo->x_3d,this_hostextinfo->y_3d,this_hostextinfo->z_3d,this_hostextinfo->have_2d_coords,this_hostextinfo->have_3d_coords); /* return with an error if we couldn't add the definition */ *************** *** 7727,7731 **** /* register the extended service object */ ! new_serviceextinfo=add_serviceextinfo(this_serviceextinfo->host_name,this_serviceextinfo->service_description,this_serviceextinfo->notes,this_serviceextinfo->notes_url,this_serviceextinfo->icon_image,this_serviceextinfo->icon_image_alt); /* return with an error if we couldn't add the definition */ --- 7757,7761 ---- /* register the extended service object */ ! new_serviceextinfo=add_serviceextinfo(this_serviceextinfo->host_name,this_serviceextinfo->service_description,this_serviceextinfo->notes,this_serviceextinfo->notes_url,this_serviceextinfo->action_url,this_serviceextinfo->icon_image,this_serviceextinfo->icon_image_alt); /* return with an error if we couldn't add the definition */ *************** *** 8238,8241 **** --- 8268,8273 ---- if(temp_hostextinfo->notes_url) fprintf(fp,"notes_url\t%s\n",temp_hostextinfo->notes_url); + if(temp_hostextinfo->action_url) + fprintf(fp,"action_url\t%s\n",temp_hostextinfo->action_url); fprintf(fp,"}\n"); } *************** *** 8258,8261 **** --- 8290,8295 ---- if(temp_serviceextinfo->notes_url) fprintf(fp,"notes_url\t%s\n",temp_serviceextinfo->notes_url); + if(temp_serviceextinfo->action_url) + fprintf(fp,"action_url\t%s\n",temp_serviceextinfo->action_url); fprintf(fp,"}\n"); } *************** *** 8504,8507 **** --- 8538,8542 ---- free(this_hostextinfo->notes); free(this_hostextinfo->notes_url); + free(this_hostextinfo->action_url); free(this_hostextinfo->icon_image); free(this_hostextinfo->icon_image_alt); *************** *** 8522,8525 **** --- 8557,8561 ---- free(this_serviceextinfo->notes); free(this_serviceextinfo->notes_url); + free(this_serviceextinfo->action_url); free(this_serviceextinfo->icon_image); free(this_serviceextinfo->icon_image_alt); Index: xodtemplate.h =================================================================== RCS file: /cvsroot/nagios/nagios/xdata/xodtemplate.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** xodtemplate.h 3 Jun 2003 05:10:28 -0000 1.30 --- xodtemplate.h 18 Jun 2003 00:45:33 -0000 1.31 *************** *** 4,8 **** * * Copyright (c) 2001-2003 Ethan Galstad (na...@na...) ! * Last Modified: 06-02-2003 * * License: --- 4,8 ---- * * Copyright (c) 2001-2003 Ethan Galstad (na...@na...) ! * Last Modified: 06-17-2003 * * License: *************** *** 458,461 **** --- 458,462 ---- char *notes; char *notes_url; + char *action_url; char *icon_image; char *icon_image_alt; *************** *** 489,492 **** --- 490,494 ---- char *notes; char *notes_url; + char *action_url; char *icon_image; char *icon_image_alt; Index: xrddefault.c =================================================================== RCS file: /cvsroot/nagios/nagios/xdata/xrddefault.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** xrddefault.c 11 May 2003 06:16:53 -0000 1.15 --- xrddefault.c 18 Jun 2003 00:45:33 -0000 1.16 *************** *** 4,8 **** * * Copyright (c) 1999-2003 Ethan Galstad (na...@na...) ! * Last Modified: 05-08-2003 * * License: --- 4,8 ---- * * Copyright (c) 1999-2003 Ethan Galstad (na...@na...) ! * Last Modified: 06-17-2003 * * License: *************** *** 388,391 **** --- 388,395 ---- if(temp_service->current_state!=STATE_OK && temp_service->last_notification!=(time_t)0) temp_service->next_notification=get_next_service_notification_time(temp_service,temp_service->last_notification); + + /* fix old vars */ + if(temp_service->has_been_checked==FALSE && temp_service->state_type==SOFT_STATE) + temp_service->state_type=HARD_STATE; /* update service status */ |