Пример #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 host */
void disable_host_flap_detection(host *hst) {
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

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

	if (hst == NULL)
		return;

	log_debug_info(DEBUGL_FLAPPING, 1, "Disabling flap detection for host '%s'.\n", hst->name);

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

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

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

#ifdef USE_EVENT_BROKER
	/* send data to event broker */
	broker_adaptive_host_data(NEBTYPE_ADAPTIVEHOST_UPDATE, NEBFLAG_NONE, NEBATTR_NONE, hst, CMD_NONE, attr, hst->modified_attributes, NULL);
#endif

	/* handle the details... */
	handle_host_flap_detection_disabled(hst);

	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;
}