else if(!strcmp(variables[x],"host")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
}
host_name=(char *)malloc(strlen(variables[x])+1);
if(host_name==NULL)
host_name="";
else
strcpy(host_name,variables[x]);
}
/* we found the hostgroup name */
else if(!strcmp(variables[x],"hostgroup")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
}
hostgroup_name=(char *)malloc(strlen(variables[x])+1);
if(hostgroup_name==NULL)
hostgroup_name="";
else
strcpy(hostgroup_name,variables[x]);
}
/* we found the service name */
else if(!strcmp(variables[x],"service")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
}
service_desc=(char *)malloc(strlen(variables[x])+1);
if(service_desc==NULL)
service_desc="";
else
strcpy(service_desc,variables[x]);
}
/* we found the servicegroup name */
else if(!strcmp(variables[x],"servicegroup")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
}
servicegroup_name=(char *)malloc(strlen(variables[x])+1);
if(servicegroup_name==NULL)
servicegroup_name="";
else
strcpy(servicegroup_name,variables[x]);
}
/* we got the persistence option for a comment */
else if(!strcmp(variables[x],"persistent"))
persistent_comment=TRUE;
/* we got the notification option for an acknowledgement */
else if(!strcmp(variables[x],"send_notification"))
send_notification=TRUE;
/* we got the acknowledgement type */
else if(!strcmp(variables[x],"sticky_ack"))
sticky_ack=TRUE;
/* we got the service check force option */
else if(!strcmp(variables[x],"force_check"))
force_check=TRUE;
/* we got the option to affect host and all its services */
else if(!strcmp(variables[x],"ahas"))
affect_host_and_services=TRUE;
/* we got the option to propagate to child hosts */
else if(!strcmp(variables[x],"ptc"))
propagate_to_children=TRUE;
/* we got the option for fixed downtime */
else if(!strcmp(variables[x],"fixed")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
}
fixed=(atoi(variables[x])>0)?TRUE:FALSE;
}
/* we got the triggered by downtime option */
else if(!strcmp(variables[x],"trigger")){
x++;
if(variables[x]==NULL){
error=TRUE;
break;
=5= |