# Print all nodes with filemgr plugin installed
mco find –with-agent filemgr
# Print all nodes where the last puppet run took more than 50 seconds
mco find -S “resource().total_time>50”
# Complex hostname filters
mco find -S “hostname=/(?i:hostname77[4-9])/”
mco find -S “hostname=/(?i:hostname77+)/”
mco find -S “hostname=/(?i:hostname(72|79|85|84))/”
mco find -S ‘!hostname=/(?i:hostname[12]7*)/’
mco find -S “not hostname=/(?i-mx:hostname[12]dev7*)/”
mco find -S “hostname=/(?i:hostname(\d))/”
mco find -S “hostname=/(?i:hostname{3,})/”
mco find -S “hostname=/(?i-mx:hostname([2-5]|0|7))/”
# Find hosts by md5sum of /etc/hosts
mco find -S “fstat(‘/etc/hosts’).md5=/462528a8bfcd7/”
# Get status of file on three nodes, can also use touch or remove instead of status
mco filemgr -f /etc/hosts status -S “hostname=hostname1” -d
# Get list of directory contents of /var/tmp/hotfixes
mco rpc filemgr status file=/tmp dirlist=true
# Get status of bis service on three nodes, can also use stop or start instead of status
mco rpc service status service=bis -S “hostname=hostname1”
# Restart bis service in batches of two, pausing 10 seconds between batches in dev
mco rpc service restart service=httpd –batch 2 –batch-sleep 10 -S “environment=dev”
# Get status of puppet agent on three nodes
mco puppet status -S “hostname=hostname1”
# Run puppet agent noop on three nodes for mcollective
mco puppet runonce –noop –tags mcollective -S “hostname=hostname1”
# Run puppet agent noop for mcollective, 5 nodes at a time, in site1. Use this for running pagent on more than 10 nodes at once.
mco puppet runall 5 –noop –tags mcollective -S “environment=dev”
# Get last run summary
mco rpc puppet last_run_summary -S “hostname=hostname1”
# Get last run summary including the last log details
mco rpc puppet last_run_summary parse_log=true -S “hostname=hostname1”
# List yum check updates, 20 nodes at a time
mco rpc package checkupdates –batch 20 -S “environment=dev” | egrep -v “:”
# Get service info, including chkconfig settings
mco rpc puppetral find type=service title=’ntpd’ -S “environment=dev and /ntp/”
# Retrieve os_family for all dev nodes, use -v for per node details
mco facts os_family -S “environment=dev”