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

Function printOutput

plugins/check_procs.cpp:130–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static int printOutput(const int numProcs, printInfoStruct& printInfo)
131{
132 if (l_Debug)
133 std::wcout << L"Constructing output string" << '\n';
134
135 state state = OK;
136
137 if (printInfo.warn.rend(numProcs))
138 state = WARNING;
139
140 if (printInfo.crit.rend(numProcs))
141 state = CRITICAL;
142
143 std::wstring user;
144 if (!printInfo.user.empty())
145 user = L" processes of user " + printInfo.user;
146
147 std::wcout << L"PROCS ";
148
149 switch (state) {
150 case OK:
151 std::wcout << L"OK";
152 break;
153 case WARNING:
154 std::wcout << L"WARNING";
155 break;
156 case CRITICAL:
157 std::wcout << L"CRITICAL";
158 break;
159 }
160
161 std::wcout << L" " << numProcs << user << L" | procs=" << numProcs << L";"
162 << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
163
164 return state;
165}
166
167static int countProcs()
168{

Callers 1

wmainFunction · 0.70

Calls 3

rendMethod · 0.80
pStringMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected