diff --git a/modules/console.cc b/modules/console.cc index 496fc1230..089c0dfa9 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -939,6 +939,42 @@ console_cmd__peer(opt &out, const string_view &line) return true; } +bool +console_cmd__peer__error(opt &out, const string_view &line) +{ + for(const auto &pair : ircd::server::peers) + { + using std::setw; + using std::left; + using std::right; + + const auto &host{pair.first}; + assert(bool(pair.second)); + const auto &peer{*pair.second}; + if(!peer.err_has()) + continue; + + const net::ipport &ipp{peer.remote}; + out << setw(40) << right << host; + + if(ipp) + out << ' ' << setw(22) << left << ipp; + else + out << ' ' << setw(22) << left << " "; + + out << peer.e->etime; + + if(peer.err_msg()) + out << " :" << peer.err_msg(); + else + out << " "_sv; + + out << std::endl; + } + + return true; +} + bool console_cmd__peer__error__clear__all(opt &out, const string_view &line) {