1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "icinga/checkable.hpp"
4 #include "icinga/host.hpp"
5 #include "icinga/icingaapplication.hpp"
6 #include "icinga/customvarobject.hpp"
7 #impl_include "icinga/servicegroup.hpp"
15 class ServiceNameComposer : public NameComposer
18 virtual String MakeName(const String& shortName, const Object::Ptr& context) const;
19 virtual Dictionary::Ptr ParseName(const String& name) const;
23 class Service : Checkable < ServiceNameComposer
25 load_after ApiListener;
30 [config, no_user_modify, required] array(name(ServiceGroup)) groups {
31 default {{{ return new Array(); }}}
34 [config] String display_name {
36 if (m_DisplayName.IsEmpty())
37 return GetShortName();
42 [config, required] name(Host) host_name;
43 [no_storage, navigation] Host::Ptr host {
49 [enum, no_storage] ServiceState "state" {
54 [enum, no_storage] ServiceState last_state {
56 return GetLastStateRaw();
59 [enum, no_storage] ServiceState last_hard_state {
61 return GetLastHardStateRaw();
64 [state] Timestamp last_state_ok (LastStateOK);
65 [state] Timestamp last_state_warning;
66 [state] Timestamp last_state_critical;
67 [state] Timestamp last_state_unknown;