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

Function printOutput

plugins/check_users.cpp:123–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static int printOutput(printInfoStruct& printInfo)
124{
125 if (l_Debug)
126 std::wcout << L"Constructing output string" << '\n';
127
128 state state = OK;
129
130 if (printInfo.warn.rend(printInfo.users))
131 state = WARNING;
132
133 if (printInfo.crit.rend(printInfo.users))
134 state = CRITICAL;
135
136 switch (state) {
137 case OK:
138 std::wcout << L"USERS OK " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
139 << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
140 break;
141 case WARNING:
142 std::wcout << L"USERS WARNING " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
143 << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
144 break;
145 case CRITICAL:
146 std::wcout << L"USERS CRITICAL " << printInfo.users << L" User(s) logged in | 'users'=" << printInfo.users << L";"
147 << printInfo.warn.pString() << L";" << printInfo.crit.pString() << L";0;" << '\n';
148 break;
149 }
150
151 return state;
152}
153
154static int check_users(printInfoStruct& printInfo)
155{

Callers 1

wmainFunction · 0.70

Calls 2

rendMethod · 0.80
pStringMethod · 0.80

Tested by

no test coverage detected