1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software Foundation *
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ******************************************************************************/
23 #include "livestatus/table.hpp"
25 using namespace icinga;
33 class HostsTable final : public Table
36 DECLARE_PTR_TYPEDEFS(HostsTable);
38 HostsTable(LivestatusGroupByType type = LivestatusGroupByNone);
40 static void AddColumns(Table *table, const String& prefix = String(),
41 const Column::ObjectAccessor& objectAccessor = Column::ObjectAccessor());
43 String GetName() const override;
44 String GetPrefix() const override;
47 void FetchRows(const AddRowFunction& addRowFn) override;
49 static Object::Ptr HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject);
51 static Value NameAccessor(const Value& row);
52 static Value DisplayNameAccessor(const Value& row);
53 static Value AddressAccessor(const Value& row);
54 static Value Address6Accessor(const Value& row);
55 static Value CheckCommandAccessor(const Value& row);
56 static Value CheckCommandExpandedAccessor(const Value& row);
57 static Value EventHandlerAccessor(const Value& row);
58 static Value CheckPeriodAccessor(const Value& row);
59 static Value NotesAccessor(const Value& row);
60 static Value NotesExpandedAccessor(const Value& row);
61 static Value NotesUrlAccessor(const Value& row);
62 static Value NotesUrlExpandedAccessor(const Value& row);
63 static Value ActionUrlAccessor(const Value& row);
64 static Value ActionUrlExpandedAccessor(const Value& row);
65 static Value PluginOutputAccessor(const Value& row);
66 static Value PerfDataAccessor(const Value& row);
67 static Value IconImageAccessor(const Value& row);
68 static Value IconImageExpandedAccessor(const Value& row);
69 static Value IconImageAltAccessor(const Value& row);
70 static Value LongPluginOutputAccessor(const Value& row);
71 static Value MaxCheckAttemptsAccessor(const Value& row);
72 static Value FlapDetectionEnabledAccessor(const Value& row);
73 static Value ProcessPerformanceDataAccessor(const Value& row);
74 static Value AcceptPassiveChecksAccessor(const Value& row);
75 static Value EventHandlerEnabledAccessor(const Value& row);
76 static Value AcknowledgementTypeAccessor(const Value& row);
77 static Value CheckTypeAccessor(const Value& row);
78 static Value LastStateAccessor(const Value& row);
79 static Value LastHardStateAccessor(const Value& row);
80 static Value CurrentAttemptAccessor(const Value& row);
81 static Value LastNotificationAccessor(const Value& row);
82 static Value NextNotificationAccessor(const Value& row);
83 static Value NextCheckAccessor(const Value& row);
84 static Value LastHardStateChangeAccessor(const Value& row);
85 static Value HasBeenCheckedAccessor(const Value& row);
86 static Value CurrentNotificationNumberAccessor(const Value& row);
87 static Value TotalServicesAccessor(const Value& row);
88 static Value ChecksEnabledAccessor(const Value& row);
89 static Value NotificationsEnabledAccessor(const Value& row);
90 static Value AcknowledgedAccessor(const Value& row);
91 static Value StateAccessor(const Value& row);
92 static Value StateTypeAccessor(const Value& row);
93 static Value NoMoreNotificationsAccessor(const Value& row);
94 static Value LastCheckAccessor(const Value& row);
95 static Value LastStateChangeAccessor(const Value& row);
96 static Value LastTimeUpAccessor(const Value& row);
97 static Value LastTimeDownAccessor(const Value& row);
98 static Value LastTimeUnreachableAccessor(const Value& row);
99 static Value IsFlappingAccessor(const Value& row);
100 static Value ScheduledDowntimeDepthAccessor(const Value& row);
101 static Value ActiveChecksEnabledAccessor(const Value& row);
102 static Value CheckOptionsAccessor(const Value& row);
103 static Value CheckIntervalAccessor(const Value& row);
104 static Value RetryIntervalAccessor(const Value& row);
105 static Value NotificationIntervalAccessor(const Value& row);
106 static Value LowFlapThresholdAccessor(const Value& row);
107 static Value HighFlapThresholdAccessor(const Value& row);
108 static Value LatencyAccessor(const Value& row);
109 static Value ExecutionTimeAccessor(const Value& row);
110 static Value PercentStateChangeAccessor(const Value& row);
111 static Value InNotificationPeriodAccessor(const Value& row);
112 static Value InCheckPeriodAccessor(const Value& row);
113 static Value ContactsAccessor(const Value& row);
114 static Value DowntimesAccessor(const Value& row);
115 static Value DowntimesWithInfoAccessor(const Value& row);
116 static Value CommentsAccessor(const Value& row);
117 static Value CommentsWithInfoAccessor(const Value& row);
118 static Value CommentsWithExtraInfoAccessor(const Value& row);
119 static Value CustomVariableNamesAccessor(const Value& row);
120 static Value CustomVariableValuesAccessor(const Value& row);
121 static Value CustomVariablesAccessor(const Value& row);
122 static Value ParentsAccessor(const Value& row);
123 static Value ChildsAccessor(const Value& row);
124 static Value NumServicesAccessor(const Value& row);
125 static Value WorstServiceStateAccessor(const Value& row);
126 static Value NumServicesOkAccessor(const Value& row);
127 static Value NumServicesWarnAccessor(const Value& row);
128 static Value NumServicesCritAccessor(const Value& row);
129 static Value NumServicesUnknownAccessor(const Value& row);
130 static Value NumServicesPendingAccessor(const Value& row);
131 static Value WorstServiceHardStateAccessor(const Value& row);
132 static Value NumServicesHardOkAccessor(const Value& row);
133 static Value NumServicesHardWarnAccessor(const Value& row);
134 static Value NumServicesHardCritAccessor(const Value& row);
135 static Value NumServicesHardUnknownAccessor(const Value& row);
136 static Value HardStateAccessor(const Value& row);
137 static Value StalenessAccessor(const Value& row);
138 static Value GroupsAccessor(const Value& row);
139 static Value ContactGroupsAccessor(const Value& row);
140 static Value ServicesAccessor(const Value& row);
141 static Value ServicesWithStateAccessor(const Value& row);
142 static Value ServicesWithInfoAccessor(const Value& row);
143 static Value CheckSourceAccessor(const Value& row);
144 static Value IsReachableAccessor(const Value& row);
145 static Value CVIsJsonAccessor(const Value& row);
146 static Value OriginalAttributesAccessor(const Value& row);
151 #endif /* HOSTSTABLE_H */