void DbEvents::AddCommentInternal(const Checkable::Ptr& checkable, const Comment::Ptr& comment, bool historical)
{
if (!comment) {
- Log(LogWarning, "db_ido", "comment does not exist. not adding it.");
+ Log(LogWarning, "DbEvents", "comment does not exist. not adding it.");
return;
}
- Log(LogDebug, "db_ido", "adding service comment (id = " + Convert::ToString(comment->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "adding service comment (id = " + Convert::ToString(comment->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
/* add the service comment */
AddCommentByType(checkable, comment, historical);
fields1->Set("comment_type", 1);
fields1->Set("internal_comment_id", comment->GetLegacyId());
} else {
- Log(LogDebug, "db_ido", "unknown object type for adding comment.");
+ Log(LogDebug, "DbEvents", "unknown object type for adding comment.");
return;
}
void DbEvents::RemoveComments(const Checkable::Ptr& checkable)
{
- Log(LogDebug, "db_ido", "removing service comments for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "removing service comments for '" + checkable->GetName() + "'");
DbQuery query1;
query1.Table = "comments";
void DbEvents::RemoveComment(const Checkable::Ptr& checkable, const Comment::Ptr& comment)
{
if (!comment) {
- Log(LogWarning, "db_ido", "comment does not exist. not deleting it.");
+ Log(LogWarning, "DbEvents", "comment does not exist. not deleting it.");
return;
}
- Log(LogDebug, "db_ido", "removing service comment (id = " + Convert::ToString(comment->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "removing service comment (id = " + Convert::ToString(comment->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
/* Status */
DbQuery query1;
void DbEvents::AddDowntimeInternal(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime, bool historical)
{
if (!downtime) {
- Log(LogWarning, "db_ido", "downtime does not exist. not adding it.");
+ Log(LogWarning, "DbEvents", "downtime does not exist. not adding it.");
return;
}
- Log(LogDebug, "db_ido", "adding service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "adding service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
/* add the downtime */
AddDowntimeByType(checkable, downtime, historical);}
fields1->Set("downtime_type", 1);
fields1->Set("internal_downtime_id", downtime->GetLegacyId());
} else {
- Log(LogDebug, "db_ido", "unknown object type for adding downtime.");
+ Log(LogDebug, "DbEvents", "unknown object type for adding downtime.");
return;
}
void DbEvents::RemoveDowntimes(const Checkable::Ptr& checkable)
{
- Log(LogDebug, "db_ido", "removing service downtimes for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "removing service downtimes for '" + checkable->GetName() + "'");
DbQuery query1;
query1.Table = "scheduleddowntime";
void DbEvents::RemoveDowntime(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime)
{
if (!downtime) {
- Log(LogWarning, "db_ido", "downtime does not exist. not adding it.");
+ Log(LogWarning, "DbEvents", "downtime does not exist. not adding it.");
return;
}
- Log(LogDebug, "db_ido", "removing service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "removing service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
/* Status */
DbQuery query1;
void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime)
{
if (!downtime) {
- Log(LogWarning, "db_ido", "downtime does not exist. not updating it.");
+ Log(LogWarning, "DbEvents", "downtime does not exist. not updating it.");
return;
}
- Log(LogDebug, "db_ido", "updating triggered service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "updating triggered service downtime (id = " + Convert::ToString(downtime->GetLegacyId()) + ") for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
void DbEvents::AddAcknowledgementHistory(const Checkable::Ptr& checkable, const String& author, const String& comment,
AcknowledgementType type, double expiry)
{
- Log(LogDebug, "db_ido", "add acknowledgement history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add acknowledgement history for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
void DbEvents::AddAcknowledgement(const Checkable::Ptr& checkable, AcknowledgementType type)
{
- Log(LogDebug, "db_ido", "add acknowledgement for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add acknowledgement for '" + checkable->GetName() + "'");
AddAcknowledgementInternal(checkable, type, true);
}
void DbEvents::RemoveAcknowledgement(const Checkable::Ptr& checkable)
{
- Log(LogDebug, "db_ido", "remove acknowledgement for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "remove acknowledgement for '" + checkable->GetName() + "'");
AddAcknowledgementInternal(checkable, AcknowledgementNone, false);
}
void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
const CheckResult::Ptr& cr, const String& author, const String& text)
{
- Log(LogDebug, "db_ido", "add notification history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add notification history for '" + checkable->GetName() + "'");
/* start and end happen at the same time */
double now = Utility::GetTime();
/* filtered users */
BOOST_FOREACH(const User::Ptr& user, users) {
- Log(LogDebug, "db_ido", "add contact notification history for service '" + checkable->GetName() + "' and user '" + user->GetName() + "'.");
+ Log(LogDebug, "DbEvents", "add contact notification history for service '" + checkable->GetName() + "' and user '" + user->GetName() + "'.");
Dictionary::Ptr fields2 = make_shared<Dictionary>();
fields2->Set("contact_object_id", user);
/* statehistory */
void DbEvents::AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
{
- Log(LogDebug, "db_ido", "add state change history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add state change history for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
type = LogEntryTypeServiceCritical;
break;
default:
- Log(LogCritical, "db_ido", "Unknown service state: " + Convert::ToString(state_after));
+ Log(LogCritical, "DbEvents", "Unknown service state: " + Convert::ToString(state_after));
return;
}
} else {
type = LogEntryTypeHostDown;
break;
default:
- Log(LogCritical, "db_ido", "Unknown host state: " + Convert::ToString(state_after));
+ Log(LogCritical, "DbEvents", "Unknown host state: " + Convert::ToString(state_after));
return;
}
flapping_state_str = "DISABLED";
break;
default:
- Log(LogCritical, "db_ido", "Unknown flapping state: " + Convert::ToString(flapping_state));
+ Log(LogCritical, "DbEvents", "Unknown flapping state: " + Convert::ToString(flapping_state));
return;
}
void DbEvents::AddLogHistory(const Checkable::Ptr& checkable, String buffer, LogEntryType type)
{
- Log(LogDebug, "db_ido", "add log entry history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add log entry history for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
/* flappinghistory */
void DbEvents::AddFlappingHistory(const Checkable::Ptr& checkable, FlappingState flapping_state)
{
- Log(LogDebug, "db_ido", "add flapping history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add flapping history for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
fields1->Set("reason_type", 2);
break;
default:
- Log(LogDebug, "db_ido", "Unhandled flapping state: " + Convert::ToString(flapping_state));
+ Log(LogDebug, "DbEvents", "Unhandled flapping state: " + Convert::ToString(flapping_state));
return;
}
if (!cr)
return;
- Log(LogDebug, "db_ido", "add service check history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add service check history for '" + checkable->GetName() + "'");
Host::Ptr host;
Service::Ptr service;
/* eventhandlers */
void DbEvents::AddEventHandlerHistory(const Checkable::Ptr& checkable)
{
- Log(LogDebug, "db_ido", "add eventhandler history for '" + checkable->GetName() + "'");
+ Log(LogDebug, "DbEvents", "add eventhandler history for '" + checkable->GetName() + "'");
double now = Utility::GetTime();
std::pair<unsigned long, unsigned long> time_bag = CompatUtility::ConvertTimestamp(now);
/* externalcommands */
void DbEvents::AddExternalCommandHistory(double time, const String& command, const std::vector<String>& arguments)
{
- Log(LogDebug, "db_ido", "add external command history");
+ Log(LogDebug, "DbEvents", "add external command history");
DbQuery query1;
query1.Table = "externalcommands";
if (GetType()->GetTable() != "endpoint") {
String node = IcingaApplication::GetInstance()->GetNodeName();
- Log(LogDebug, "db_ido", "Endpoint node: '" + node + "' status update for '" + GetObject()->GetName() + "'");
+ Log(LogDebug, "DbObject", "Endpoint node: '" + node + "' status update for '" + GetObject()->GetName() + "'");
Endpoint::Ptr endpoint = Endpoint::GetByName(node);
if (endpoint)
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
if (vars) {
- Log(LogDebug, "db_ido", "Updating object vars for '" + custom_var_object->GetName() + "'");
+ Log(LogDebug, "DbObject", "Updating object vars for '" + custom_var_object->GetName() + "'");
ObjectLock olock (vars);
if (!kv.first.IsEmpty()) {
int overridden = custom_var_object->IsVarOverridden(kv.first) ? 1 : 0;
- Log(LogDebug, "db_ido", "object customvar key: '" + kv.first + "' value: '" + Convert::ToString(kv.second) +
+ Log(LogDebug, "DbObject", "object customvar key: '" + kv.first + "' value: '" + Convert::ToString(kv.second) +
"' overridden: " + Convert::ToString(overridden));
Dictionary::Ptr fields = make_shared<Dictionary>();
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
if (vars) {
- Log(LogDebug, "db_ido", "Updating object vars for '" + custom_var_object->GetName() + "'");
+ Log(LogDebug, "DbObject", "Updating object vars for '" + custom_var_object->GetName() + "'");
ObjectLock olock (vars);
if (!kv.first.IsEmpty()) {
int overridden = custom_var_object->IsVarOverridden(kv.first) ? 1 : 0;
- Log(LogDebug, "db_ido", "object customvar key: '" + kv.first + "' value: '" + Convert::ToString(kv.second) +
+ Log(LogDebug, "DbObject", "object customvar key: '" + kv.first + "' value: '" + Convert::ToString(kv.second) +
"' overridden: " + Convert::ToString(overridden));
Dictionary::Ptr fields = make_shared<Dictionary>();
{
DbObject::Ptr dbobj = GetOrCreateByObject(object);
- Log(LogDebug, "db_ido", "Vars changed for object '" + object->GetName() + "'");
+ Log(LogDebug, "DbObject", "Vars changed for object '" + object->GetName() + "'");
if (!dbobj)
return;
if (!parent)
continue;
- Log(LogDebug, "db_ido", "host parents: " + parent->GetName());
+ Log(LogDebug, "HostDbObject", "host parents: " + parent->GetName());
/* parents: host_id, parent_host_object_id */
Dictionary::Ptr fields1 = make_shared<Dictionary>();
}
/* host dependencies */
- Log(LogDebug, "db_ido", "host dependencies for '" + host->GetName() + "'");
+ Log(LogDebug, "HostDbObject", "host dependencies for '" + host->GetName() + "'");
BOOST_FOREACH(const Dependency::Ptr& dep, host->GetDependencies()) {
Checkable::Ptr parent = dep->GetParent();
if (!parent) {
- Log(LogDebug, "db_ido", "Missing parent for dependency '" + dep->GetName() + "'.");
+ Log(LogDebug, "HostDbObject", "Missing parent for dependency '" + dep->GetName() + "'.");
continue;
}
int state_filter = dep->GetStateFilter();
- Log(LogDebug, "db_ido", "parent host: " + parent->GetName());
+ Log(LogDebug, "HostDbObject", "parent host: " + parent->GetName());
Dictionary::Ptr fields2 = make_shared<Dictionary>();
fields2->Set("host_object_id", parent);
OnQuery(query2);
}
- Log(LogDebug, "db_ido", "host contacts: " + host->GetName());
+ Log(LogDebug, "HostDbObject", "host contacts: " + host->GetName());
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetCheckableNotificationUsers(host)) {
- Log(LogDebug, "db_ido", "host contacts: " + user->GetName());
+ Log(LogDebug, "HostDbObject", "host contacts: " + user->GetName());
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
OnQuery(query_contact);
}
- Log(LogDebug, "db_ido", "host contactgroups: " + host->GetName());
+ Log(LogDebug, "HostDbObject", "host contactgroups: " + host->GetName());
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetCheckableNotificationUserGroups(host)) {
- Log(LogDebug, "db_ido", "host contactgroups: " + usergroup->GetName());
+ Log(LogDebug, "HostDbObject", "host contactgroups: " + usergroup->GetName());
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
Service::Ptr service = static_pointer_cast<Service>(GetObject());
/* service dependencies */
- Log(LogDebug, "db_ido", "service dependencies for '" + service->GetName() + "'");
+ Log(LogDebug, "ServiceDbObject", "service dependencies for '" + service->GetName() + "'");
BOOST_FOREACH(const Dependency::Ptr& dep, service->GetDependencies()) {
Checkable::Ptr parent = dep->GetParent();
if (!parent) {
- Log(LogDebug, "db_ido", "Missing parent for dependency '" + dep->GetName() + "'.");
+ Log(LogDebug, "ServiceDbObject", "Missing parent for dependency '" + dep->GetName() + "'.");
continue;
}
- Log(LogDebug, "db_ido", "service parents: " + parent->GetName());
+ Log(LogDebug, "ServiceDbObject", "service parents: " + parent->GetName());
int state_filter = dep->GetStateFilter();
}
/* service contacts, contactgroups */
- Log(LogDebug, "db_ido", "service contacts: " + service->GetName());
+ Log(LogDebug, "ServiceDbObject", "service contacts: " + service->GetName());
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetCheckableNotificationUsers(service)) {
- Log(LogDebug, "db_ido", "service contacts: " + user->GetName());
+ Log(LogDebug, "ServiceDbObject", "service contacts: " + user->GetName());
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));
OnQuery(query_contact);
}
- Log(LogDebug, "db_ido", "service contactgroups: " + service->GetName());
+ Log(LogDebug, "ServiceDbObject", "service contactgroups: " + service->GetName());
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetCheckableNotificationUserGroups(service)) {
- Log(LogDebug, "db_ido", "service contactgroups: " + usergroup->GetName());
+ Log(LogDebug, "ServiceDbObject", "service contactgroups: " + usergroup->GetName());
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));