{ "icon_image", host->GetIconImage() },
{ "icon_image_alt", host->GetIconImageAlt() },
{ "notification_interval", CompatUtility::GetCheckableNotificationNotificationInterval(host) },
- { "notify_on_down", (notificationStateFilter & ServiceWarning) || (notificationStateFilter && ServiceCritical) },
+ { "notify_on_down", (notificationStateFilter & (ServiceWarning | ServiceCritical)) ? 1 : 0 },
{ "notify_on_unreachable", 1 }, /* We don't have this filter and state, and as such we don't filter such notifications. */
- { "notify_on_recovery", notificationTypeFilter & NotificationRecovery },
- { "notify_on_flapping", (notificationTypeFilter & NotificationFlappingStart) || (notificationTypeFilter & NotificationFlappingEnd) },
- { "notify_on_downtime", (notificationTypeFilter & NotificationDowntimeStart) || (notificationTypeFilter & NotificationDowntimeEnd) || (notificationTypeFilter & NotificationDowntimeRemoved) }
+ { "notify_on_recovery", (notificationTypeFilter & NotificationRecovery) ? 1 : 0 },
+ { "notify_on_flapping", (notificationTypeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
+ { "notify_on_downtime", (notificationTypeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 }
});
}
{ "dependent_host_object_id", host },
{ "inherits_parent", 1 },
{ "timeperiod_object_id", dep->GetPeriod() },
- { "fail_on_up", stateFilter & StateFilterUp },
- { "fail_on_down", stateFilter & StateFilterDown },
+ { "fail_on_up", (stateFilter & StateFilterUp) ? 1 : 0 },
+ { "fail_on_down", (stateFilter & StateFilterDown) ? 1 : 0 },
{ "instance_id", 0 } /* DbConnection class fills in real ID */
});
queries.emplace_back(std::move(query2));
{ "icon_image", service->GetIconImage() },
{ "icon_image_alt", service->GetIconImageAlt() },
{ "notification_interval", CompatUtility::GetCheckableNotificationNotificationInterval(service) },
- { "notify_on_warning", notificationStateFilter & ServiceWarning },
- { "notify_on_unknown", notificationStateFilter & ServiceUnknown },
- { "notify_on_critical", notificationStateFilter & ServiceCritical },
- { "notify_on_recovery", notificationTypeFilter & NotificationRecovery },
- { "notify_on_flapping", (notificationTypeFilter & NotificationFlappingStart) || (notificationTypeFilter & NotificationFlappingEnd) },
- { "notify_on_downtime", (notificationTypeFilter & NotificationDowntimeStart) || (notificationTypeFilter & NotificationDowntimeEnd) || (notificationTypeFilter & NotificationDowntimeRemoved) }
+ { "notify_on_warning", (notificationStateFilter & ServiceWarning) ? 1 : 0 },
+ { "notify_on_unknown", (notificationStateFilter & ServiceUnknown) ? 1 : 0 },
+ { "notify_on_critical", (notificationStateFilter & ServiceCritical) ? 1 : 0 },
+ { "notify_on_recovery", (notificationTypeFilter & NotificationRecovery) ? 1 : 0 },
+ { "notify_on_flapping", (notificationTypeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
+ { "notify_on_downtime", (notificationTypeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 }
});
}
{ "dependent_service_object_id", service },
{ "inherits_parent", 1 },
{ "timeperiod_object_id", dep->GetPeriod() },
- { "fail_on_ok", stateFilter & StateFilterOK },
- { "fail_on_warning", stateFilter & StateFilterWarning },
- { "fail_on_critical", stateFilter & StateFilterCritical },
- { "fail_on_unknown", stateFilter & StateFilterUnknown },
+ { "fail_on_ok", (stateFilter & StateFilterOK) ? 1 : 0 },
+ { "fail_on_warning", (stateFilter & StateFilterWarning) ? 1 : 0 },
+ { "fail_on_critical", (stateFilter & StateFilterCritical) ? 1 : 0 },
+ { "fail_on_unknown", (stateFilter & StateFilterUnknown) ? 1 : 0 },
{ "instance_id", 0 } /* DbConnection class fills in real ID */
});
queries.emplace_back(std::move(query1));
{ "host_notifications_enabled", user->GetEnableNotifications() },
{ "service_notifications_enabled", user->GetEnableNotifications() },
{ "can_submit_commands", 1 },
- { "notify_service_recovery", (typeFilter & NotificationRecovery) != 0 },
- { "notify_service_warning", (stateFilter & StateFilterWarning) != 0 },
- { "notify_service_unknown", (stateFilter & StateFilterUnknown) != 0 },
- { "notify_service_critical", (stateFilter & StateFilterCritical) != 0 },
- { "notify_service_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) != 0 },
- { "notify_service_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) != 0 },
- { "notify_host_recovery", (typeFilter & NotificationRecovery) != 0 },
- { "notify_host_down", (stateFilter & StateFilterDown) != 0 },
- { "notify_host_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) != 0 },
- { "notify_host_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) != 0 }
+ { "notify_service_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 },
+ { "notify_service_warning", (stateFilter & StateFilterWarning) ? 1 : 0 },
+ { "notify_service_unknown", (stateFilter & StateFilterUnknown) ? 1 : 0 },
+ { "notify_service_critical", (stateFilter & StateFilterCritical) ? 1 : 0 },
+ { "notify_service_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
+ { "notify_service_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 },
+ { "notify_host_recovery", (typeFilter & NotificationRecovery) ? 1 : 0 },
+ { "notify_host_down", (stateFilter & StateFilterDown) ? 1 : 0 },
+ { "notify_host_flapping", (typeFilter & (NotificationFlappingStart | NotificationFlappingEnd)) ? 1 : 0 },
+ { "notify_host_downtime", (typeFilter & (NotificationDowntimeStart | NotificationDowntimeEnd | NotificationDowntimeRemoved)) ? 1 : 0 }
});
}