diff options
Diffstat (limited to 'cpp/src/IceGrid/Parser.cpp')
-rw-r--r-- | cpp/src/IceGrid/Parser.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index bd5b6519bb2..5009b2205fb 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -82,6 +82,7 @@ Parser::usage() " Describe application service template TEMPLATE.\n" "\n" "node list List all registered nodes.\n" + "node describe NAME Show information about node NAME.\n" "node ping NAME Ping node NAME.\n" "node shutdown NAME Shutdown node NAME.\n" "\n" @@ -510,6 +511,35 @@ Parser::describeServiceTemplate(const list<string>& args) } void +Parser::describeNode(const list<string>& args) +{ + if(args.size() != 1) + { + error("`node describe' requires exactly one argument\n(`help' for more info)"); + return; + } + + try + { + NodeInfo info = _admin->getNodeInfo(args.front()); + Output out(cout); + out << "node `" << args.front() << "'"; + out << sb; + out << nl << "operating system = `" << info.os << "'"; + out << nl << "host name = `" << info.hostname << "'"; + out << nl << "release = `" << info.release << "'"; + out << nl << "version = `" << info.version << "'"; + out << nl << "machine type = `" << info.machine << "'"; + out << nl << "number of processors = `" << info.nProcessors << "'"; + out << eb; + } + catch(const Ice::Exception& ex) + { + exception(ex); + } +} + +void Parser::pingNode(const list<string>& args) { if(args.size() != 1) |