Package: hpc-acm-cli
# HPC Pack ACM CLIHPC Pack ACM diagnostic tools are a set of command line tools for diagnosing HPC clusters. They’re distributed in a Python packagehpc-acm-cli, based on [HPC Pack ACM API](https://github.com/Azure/hpcpack-acm-api-python).## PrerequisitesPython 2.7, 3.5 or 3.6 is required.## InstallationThere’re several ways to install it. Usually, you should use the PyPI. Other ways are mainly for the package development.### Install from PyPIThis is a standard way to install a Python package.` python-mpip install--userhpc-acm-cli`Note:pythonmay bepython2orpython3for Python 2 or Python 3 for some Linux distributions.### Install from GitHubYou can install the latest code in development from GitHub by` python-mpip install--usergit+https://github.com/Azure/hpcpack-acm-cli.git#egg=hpc-acm-cli`### Install from SourceGet the source code to local and then execute` python-mpip install--user-e<path-to-the-source-directory>`Note: the-eoption enable the “editable” mode for the package so that any change you do in the source will take effect without reinstallation.## UsageAfter installation, there’re 3 commands avaiable:clusnode,clusdiagandclusrunfor checking cluster nodes, checking/doing diagnostic jobs and checking/running general command separately. They each have subcommands, such aslist,shownew, etc..### Notes for Python on WindowsIf you’re using a [Python release for Windows](https://www.python.org/downloads/windows/), make sure the path of theScriptsdirecotry of the Python installation is on thePATH, since the above commands are installed in this direcotry.Take Python 3.6 for example. By default, it will be installed toC:Users<username>AppDataLocalProgramsPythonPython36. And thus you need to addC:Users<username>AppDataLocalProgramsPythonPython36Scriptsto thePATH.### Common UsageExecute a command with-hparamter to list its subcommands, likeclusnode -h.For help of a subcommand, saylist, show it likeclusnode list -h.All these commands require some common parameters. They’re–host,–userand–password. You can save the values for them in a configuration file and thus avoid entering them each time you run a command. See configuration section below for more.The examples below assume you have the required parameters provided in the configuration file. You could provide them on the command line instead. But if they’re missing, you’ll encounter an error at runtime.### clusnodeclusnode is for checking cluster nodes.For example, to list the nodes in a cluster, execute` clusnode list `By default, it will list 100 nodes at once. If you prefer more, use the–countparameter, like` clusnode list--count1000 `There’s also a parameter–last-idfor paging. Refer to command help for more.To check a specific node` clusnode show<node-name>`### clusdiagclusdiag is for checking/doing diagnostic tests on a cluster.For example, to list available diagnostic tests` clusdiag tests `To run a diagnostic test` clusdiag new<test-name>--pattern<your-node-name-pattern>`The–patternis a glob pattern just like the file name globbing on most OSes. For example,abc*matches names starting withabc, and thusabc,abc1andabc2are all matched. You can use*to match all nodes.You can also specify several nodes to run the test, by the–nodesparameter, like` clusdiag new<test-name>--nodes"n1 n2 n3" `The nodes namedn1,n2andn3are specified, spearated by a space and qouted in a pair of“.To see a list of diagnostic tests` clusdiag list `To check detailed result of a test` clusdiag show <id> `### clusrunclusrun is for checking/running general command on a cluster.For example, to run a command on all nodes of the cluster:` clusrun new--pattern"*" "hostname && date" `It will executehostname && dateon all nodes in a cluster.## ConfigurationThe above commands share a common configuration file,.hpc_acm_cli_config, for default values for the command line.The file will be generated at the first time you run any of the commands. It will be put under the user’s home directory(~). Typically, it’s/home/{username}for Linux, andC:Users{username}for Windows.The configuration file sets default values for command parameters, and the default values can be overriden by those provided on command line. See comments in the file for configurable options and examples.