插件地址:
查看mc lib目录:
grep libdir /etc/mcollective/server.cfg
libdir = /usr/libexec/mcollective
安装:
cd /usr/libexec/mcollective
git clone git://github.com/puppetlabs/mcollective-plugins.git
cd /usr/libexec/mcollective/mcollective
cp /usr/libexec/mcollective/mcollective-plugins/agent/puppetd/agent/puppetd.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/puppetd/application/puppetd.rb ./application/
cp /usr/libexec/mcollective/mcollective-plugins/agent/filemgr/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/filemgr/application/*.* ./application/
cp /usr/libexec/mcollective/mcollective-plugins/agent/package/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/package/application/*.* ./application/
cp /usr/libexec/mcollective/mcollective-plugins/agent/process/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/process/application/*.* ./application/
gem install sys-proctable
cp /usr/libexec/mcollective/mcollective-plugins/agent/puppetca/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/puppetral/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/service/agent/*.* ./agent/
cp /usr/libexec/mcollective/mcollective-plugins/agent/service/application/*.* ./application/
//packge&service要改名!!!!!
重启一下MC的服务就OK了,
重启生效
/etc/init.d/mcollective restart
[root@akin ~]# mco pgrep ruby
* [============================================================> ] 2 / 2
akin.com
PID USER VSZ COMMAND
3221 puppet 173.766 MB /usr/local/bin/ruby /usr/sbin/puppetmasterd
7999 root 125.746 MB ruby /usr/sbin/mcollectived --pid=/var/run/mcollectived.pid
akin2.com
PID USER VSZ COMMAND
19289 root 121.637 MB ruby /usr/sbin/mcollectived --pid=/var/run/mcollectived.pid
25650 root 168.777 MB /usr/local/bin/ruby /usr/sbin/puppetd
---- process list stats ----
Matched hosts: 2
Matched processes: 4
Resident Size: 58.785 MB
Virtual Size: 589.926 MB
Finished processing 2 / 2 hosts in 392.70 ms
里面有些插件是要安装别的工具的,比如说dsh,他就要安装DSH的工具,不是很好用!
可以使用的命令如下:
查看文件状态:mco rpc filemgr status file=/etc/passwd
创建文件:mco rpc filemgr touch file=/tmp/akin.com.txt
删除文件:mco rpc filemgr -v remove file=/tmp/akin.com.txt
查运行进程:mco pgrep ruby
查看服务运行情况:mco service -v sshd status
安装软件:mco package -v install screen
改变puppet运行状态:mco puppetd -v runonce
其中-v是显示详细信息,,可以不加!
阅读(2030) | 评论(1) | 转发(0) |