Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/icinga/comment.ti
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ class Comment : ConfigObject < CommentNameComposer
}
}}}
navigate {{{
if (GetServiceName().IsEmpty())
return nullptr;
if (!GetServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetHostName());
if (host)
return host->GetServiceByShortName(GetServiceName());
}

Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
return nullptr;
}}}
};

Expand Down
20 changes: 12 additions & 8 deletions lib/icinga/dependency.ti
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ class Dependency : CustomVarObject < DependencyNameComposer
}
}}}
navigate {{{
if (GetChildServiceName().IsEmpty())
return nullptr;
if (!GetChildServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetChildHostName());
if (host)
return host->GetServiceByShortName(GetChildServiceName());
}

Host::Ptr host = Host::GetByName(GetChildHostName());
return host->GetServiceByShortName(GetChildServiceName());
return nullptr;
}}}
};

Expand All @@ -71,11 +73,13 @@ class Dependency : CustomVarObject < DependencyNameComposer
}
}}}
navigate {{{
if (GetParentServiceName().IsEmpty())
return nullptr;
if (!GetParentServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetParentHostName());
if (host)
return host->GetServiceByShortName(GetParentServiceName());
}

Host::Ptr host = Host::GetByName(GetParentHostName());
return host->GetServiceByShortName(GetParentServiceName());
return nullptr;
}}}
};

Expand Down
10 changes: 6 additions & 4 deletions lib/icinga/downtime.ti
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ class Downtime : ConfigObject < DowntimeNameComposer
}
}}}
navigate {{{
if (GetServiceName().IsEmpty())
return nullptr;
if (!GetServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetHostName());
if (host)
return host->GetServiceByShortName(GetServiceName());
}

Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
return nullptr;
}}}
};

Expand Down
10 changes: 6 additions & 4 deletions lib/icinga/notification.ti
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ class Notification : CustomVarObject < NotificationNameComposer
}
}}}
navigate {{{
if (GetServiceName().IsEmpty())
return nullptr;
if (!GetServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetHostName());
if (host)
return host->GetServiceByShortName(GetServiceName());
}

Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
return nullptr;
}}}
};

Expand Down
10 changes: 6 additions & 4 deletions lib/icinga/scheduleddowntime.ti
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ class ScheduledDowntime : CustomVarObject < ScheduledDowntimeNameComposer
}
}}}
navigate {{{
if (GetServiceName().IsEmpty())
return nullptr;
if (!GetServiceName().IsEmpty()) {
Host::Ptr host = Host::GetByName(GetHostName());
if (host)
return host->GetServiceByShortName(GetServiceName());
}

Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
return nullptr;
}}}
};

Expand Down
Loading