Пример #1
0
/* disables flap detection on a program wide basis */
void disable_flap_detection_routines(void) {
	host *temp_host = NULL;
	service *temp_service = NULL;
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

	log_debug_info(DEBUGL_FUNCTIONS, 0, "disable_flap_detection_routines()\n");

	/* bail out if we're already set */
	if (enable_flap_detection == FALSE)
		return;

	/* set the attribute modified flag */
	modified_host_process_attributes |= attr;
	modified_service_process_attributes |= attr;

	/* set flap detection flag */
	enable_flap_detection = FALSE;

#ifdef USE_EVENT_BROKER
	/* send data to event broker */
	broker_adaptive_program_data(NEBTYPE_ADAPTIVEPROGRAM_UPDATE, NEBFLAG_NONE, NEBATTR_NONE, CMD_NONE, attr, modified_host_process_attributes, attr, modified_service_process_attributes, NULL);
#endif

	/* update program status */
	update_program_status(FALSE);

	/* handle the details... */
	for (temp_host = host_list; temp_host != NULL; temp_host = temp_host->next)
		handle_host_flap_detection_disabled(temp_host);
	for (temp_service = service_list; temp_service != NULL; temp_service = temp_service->next)
		handle_service_flap_detection_disabled(temp_service);

	return;
}
Пример #2
0
/* disables flap detection for a specific service */
void disable_service_flap_detection(service *svc) {
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

	log_debug_info(DEBUGL_FUNCTIONS, 0, "disable_service_flap_detection()\n");

	if (svc == NULL)
		return;

	log_debug_info(DEBUGL_FLAPPING, 1, "Disabling flap detection for service '%s' on host '%s'.\n", svc->description, svc->host_name);

	/* nothing to do... */
	if (svc->flap_detection_enabled == FALSE)
		return;

	/* set the attribute modified flag */
	svc->modified_attributes |= attr;

	/* set the flap detection enabled flag */
	svc->flap_detection_enabled = FALSE;

#ifdef USE_EVENT_BROKER
	/* send data to event broker */
	broker_adaptive_service_data(NEBTYPE_ADAPTIVESERVICE_UPDATE, NEBFLAG_NONE, NEBATTR_NONE, svc, CMD_NONE, attr, svc->modified_attributes, NULL);
#endif

	/* handle the details... */
	handle_service_flap_detection_disabled(svc);

	return;
}
Пример #3
0
/* disables flap detection on a program wide basis */
void disable_flap_detection_routines(void)
{
	unsigned int i;
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

	/* bail out if we're already set */
	if (enable_flap_detection == FALSE)
		return;

	/* set the attribute modified flag */
	modified_host_process_attributes |= attr;
	modified_service_process_attributes |= attr;

	/* set flap detection flag */
	enable_flap_detection = FALSE;

	broker_adaptive_program_data(NEBTYPE_ADAPTIVEPROGRAM_UPDATE, NEBFLAG_NONE, NEBATTR_NONE, CMD_NONE, attr, modified_host_process_attributes, attr, modified_service_process_attributes);

	/* update program status */
	update_program_status(FALSE);

	/* handle the details... */
	for (i = 0; i < num_objects.hosts; i++)
		handle_host_flap_detection_disabled(host_ary[i]);
	for (i = 0; i < num_objects.services; i++)
		handle_service_flap_detection_disabled(service_ary[i]);

	return;
}