1 // +------------------------------------------------------------------+
2 // | ____ _ _ __ __ _ __ |
3 // | / ___| |__ ___ ___| | __ | \/ | |/ / |
4 // | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
5 // | | |___| | | | __/ (__| < | | | | . \ |
6 // | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
8 // | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
9 // +------------------------------------------------------------------+
11 // This file is part of Check_MK.
12 // The official homepage is at http://mathias-kettner.de/check_mk.
14 // check_mk is free software; you can redistribute it and/or modify it
15 // under the terms of the GNU General Public License as published by
16 // the Free Software Foundation in version 2. check_mk is distributed
17 // in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
18 // out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19 // PARTICULAR PURPOSE. See the GNU General Public License for more de-
20 // tails. You should have received a copy of the GNU General Public
21 // License along with GNU Make; see the file COPYING. If not, write
22 // to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 // Boston, MA 02110-1301 USA.
25 #ifndef ServiceListStateColumn_h
26 #define ServiceListStateColumn_h
28 #include "config.h" // IWYU pragma: keep
31 #include "IntColumn.h"
42 class ServiceListStateColumn
: public IntColumn
{
44 // TODO(sp) Remove the magic arithmetic
52 num_hard_ok
= (0 + 64),
53 num_hard_warn
= (1 + 64),
54 num_hard_crit
= (2 + 64),
55 num_hard_unknown
= (3 + 64),
56 worst_hard_state
= (-2 + 64),
60 ServiceListStateColumn(const std::string
&name
,
61 const std::string
&description
, int indirect_offset
,
62 int extra_offset
, int extra_extra_offset
, int offset
,
63 MonitoringCore
*mc
, Type logictype
)
64 : IntColumn(name
, description
, indirect_offset
, extra_offset
,
65 extra_extra_offset
, offset
)
67 , _logictype(logictype
) {}
69 int32_t getValue(Row row
, const contact
*auth_user
) const override
;
72 using service_list
= const Host::services_t
*;
74 using service_list
= servicesmember
*;
77 static int32_t getValueFromServices(MonitoringCore
*mc
, Type logictype
,
79 const contact
*auth_user
);
83 const Type _logictype
;
85 static void update(Type logictype
, service
*svc
, int32_t &result
);
88 #endif // ServiceListStateColumn_h