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

Function printOutput

plugins/check_load.cpp:131–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static int printOutput(printInfoStruct& printInfo)
132{
133 if (l_Debug)
134 std::wcout << L"Constructing output string" << '\n';
135
136 state state = OK;
137
138 if (printInfo.warn.rend(printInfo.load))
139 state = WARNING;
140
141 if (printInfo.crit.rend(printInfo.load))
142 state = CRITICAL;
143
144 std::wcout << L"LOAD ";
145
146 switch (state) {
147 case OK:
148 std::wcout << L"OK";
149 break;
150 case WARNING:
151 std::wcout << L"WARNING";
152 break;
153 case CRITICAL:
154 std::wcout << L"CRITICAL";
155 break;
156 }
157
158 std::wcout << " " << printInfo.load << L"% | 'load'=" << printInfo.load << L"%;"
159 << printInfo.warn.pString() << L";"
160 << printInfo.crit.pString() << L";0;100" << '\n';
161
162 return state;
163}
164
165static int check_load(printInfoStruct& printInfo)
166{

Callers 1

wmainFunction · 0.70

Calls 2

rendMethod · 0.80
pStringMethod · 0.80

Tested by

no test coverage detected