Appendix A. Tips and Tools

Useful Commands Reference

Show all configuration data about an MCollective server:

$ mco inventory hostname

Test connectivity to an MCollective server or list of them:

$ mco ping hostname
$ mco ping --nodes /path/to/hostlist

Commands for testing host services (nettest agent):

$ mco nettest ping activemq.example.net
$ mco nettest connect activemq.example.net 61613

Find hosts that match certain criteria:

$ mco find --with-identity /web/
$ mco find --with-class webserver
$ mco find --with-fact operatingsystem=CentOS
$ mco find --with-agent package
$ mco find --with "/nameserver/ operatingsystem=CentOS"
$ mco find --select "operatingsystem=Ubuntu and /operatingsystemrelease=13.10/"
$ mco find --select "( operatingsystem=CentOS and !environment=dev ) 
  and is_virtual=true"

Commands for controlling files (filemgr agent):

$ mco filemgr --file /tmp/junk touch
$ mco filemgr --file /tmp/junk --detail status
$ mco filemgr --file /tmp/junk remove

Commands for controlling packages (package agent):

$ mco package top status
$ mco package -y top install
$ mco package -y top update
$ mco package -y top uninstall
$ mco package -y top purge

Commands for controlling system services (service agent):

$ mco service ntpd status
$ mco service ntpd restart
$ mco service ntpd stop
$ mco service ntpd start

Commands for controlling the Puppet agent:

$ mco puppet count
$ mco puppet summary
$ mco puppet disable --with-identity hostname message="Know this..."
$ mco puppet ...

Get Learning MCollective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.