Skip to content

Instantly share code, notes, and snippets.

@ksexton
Created March 10, 2014 19:19
Show Gist options
  • Save ksexton/9472303 to your computer and use it in GitHub Desktop.
Save ksexton/9472303 to your computer and use it in GitHub Desktop.
mcollective cheatsheet

mcollective cheatsheet

Agents

List installed agents

$ mco plugin doc

Standard Filters

Simple regex search

$ mco find --with-identity /node/
node0.example.net
node2.example.net
node3.example.net
node1.example.net
node4.example.net
$ 

Find servers with the webserver class

$ mco find --with-class webserver
web01.example.net
web02.example.net
$

Find servers with specific fact

$ mco find --with-fact operatingsystem=CentOS
node0.example.net
node2.example.net
node3.example.net
middleware.example.net
node1.example.net
node4.example.net
$ 

Find servers with the /package/ agent installed

$ mco find --with-agent package
node0.example.net
node2.example.net
node3.example.net
middleware.example.net
node1.example.net
node4.example.net
$ 

Combination Filters

/with/ filters

$ mco ping --with "/node/ operatingsystem=CentOS"
node0.example.net                        time=29.76 ms
node3.example.net                        time=29.96 ms
node4.example.net                        time=31.83 ms
node1.example.net                        time=31.97 ms
node2.example.net                        time=32.10 ms
$

/select/ filters

$ mco ping --select "( /puppet/ or /nrpe/ ) and is_virtual=true"        
middleware.example.net                   time=30.56 ms
node0.example.net                        time=30.73 ms
node1.example.net                        time=32.79 ms
node2.example.net                        time=32.93 ms
node4.example.net                        time=33.06 ms
node3.example.net                        time=33.18 ms
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment