/* enables flap detection for a specific host */
void enable_host_flap_detection(host *hst) {
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

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

	if (hst == NULL)
		return;

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

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

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

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

#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

	/* check for flapping */
	check_for_host_flapping(hst, FALSE, FALSE, TRUE);

	/* update host status */
	update_host_status(hst, FALSE);

	return;
}
Beispiel #2
0
/* enables flap detection on a program wide basis */
void enable_flap_detection_routines(void)
{
	unsigned int i;
	unsigned long attr = MODATTR_FLAP_DETECTION_ENABLED;

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

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

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

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

#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);

	/* check for flapping */
	for (i = 0; i < num_objects.hosts; i++)
		check_for_host_flapping(host_ary[i], FALSE, FALSE, TRUE);
	for (i = 0; i < num_objects.services; i++)
		check_for_service_flapping(service_ary[i], FALSE, TRUE);

}
/* enables flap detection on a program wide basis */
void enable_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, "enable_flap_detection_routines()\n");

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

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

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

#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);

	/* check for flapping */
	for (temp_host = host_list; temp_host != NULL; temp_host = temp_host->next)
		check_for_host_flapping(temp_host, FALSE, FALSE, TRUE);
	for (temp_service = service_list; temp_service != NULL; temp_service = temp_service->next)
		check_for_service_flapping(temp_service, FALSE, TRUE);

	return;
}
Beispiel #4
0
/* enables flap detection on a program wide basis */
void enable_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 == TRUE)
		return;

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

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

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

	/* check for flapping */
	for (i = 0; i < num_objects.hosts; i++)
		check_for_host_flapping(host_ary[i], FALSE, FALSE);
	for (i = 0; i < num_objects.services; i++)
		check_for_service_flapping(service_ary[i], FALSE);

}