MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetPreviousState

Function GetPreviousState

lib/icingadb/icingadb-objects.cpp:1855–1865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1853}
1854
1855static inline
1856unsigned short GetPreviousState(const Checkable::Ptr& checkable, const Service::Ptr& service, StateType type)
1857{
1858 auto phs ((type == StateTypeHard ? checkable->GetLastHardStatesRaw() : checkable->GetLastSoftStatesRaw()) % 100u);
1859
1860 if (service || phs == ServicePending) {
1861 return phs;
1862 } else {
1863 return Host::CalculateState(ServiceState(phs));
1864 }
1865}
1866
1867void IcingaDB::SendStateChange(const ConfigObject::Ptr& object, const CheckResult::Ptr& cr, StateType type)
1868{

Callers 2

SendStateChangeMethod · 0.85
SerializeStateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected