This commit is contained in:
Your Name
2025-04-21 20:34:48 +12:00
parent 2e652be9f9
commit b53e0f6654
7 changed files with 106 additions and 4 deletions

View File

@ -131,6 +131,7 @@ void show_server_details(const std::string& server_name) {
//---------------------
// list services, and run healthcheck on each
std::cout << std::endl;
std::cout << "Services: " << server_name << std::endl;
std::cout << std::string(40, '-') << std::endl;
@ -140,13 +141,26 @@ void show_server_details(const std::string& server_name) {
std::vector<std::string> services = get_server_services(server_name);
for (const auto& service : services) {
bool healthy = false;
std::vector<int> ports;
server_service ss;
if (ss.init(server_name, service))
{
if (ss.is_healthy())
healthy=true;
std::cout << service << ": " << (healthy ? green_tick : red_cross) << std::endl;
}
ports = ss.get_ports();
}
std::cout << " " << (healthy ? green_tick : red_cross) << " " << service << ", ports: ";
std::cout << "(";
bool first = true;
for (const auto& port : ports) {
if (!first) {
std::cout << ", ";
}
std::cout << port;
first = false;
}
std::cout << ")" << std::endl;
}
}