Puppet integration Foreman (vi): mcollective command

Source: Internet
Author: User
Tags log e puppet labs

First, testing

[Email protected] ~]# MCO find puppetagent.ewin.com [[email protected] ~]# MCO pingpuppetagent.ewin.com time=91.49 ms----PING Statistics----1 replies max:91.49 min:91.49 avg:91.49

Windows Client View Logs

C:\mcollective\mcollective.log E, [2015-05-14t14:58:24.057800 #2608] ERROR--: Agents.rb:71:in ' rescue in Loadagen T ' Loading agent puppet failed:could not create instance of plugin mcollective::agent::P uppet:cannot Load such file--p Uppet

Parsing the problem is that Ruby loaded puppet plugin did not successfully error, the final reason is found in the Mcollective master profile server.cfg Libdir = C:\mcollective\plugins only point to the Lib library of Mcollective, And did not find puppet and Facter Lib library caused! Therefore, it is necessary to add puppet and Facter lib library path Libdir = C:\mcollective\plugins in Libdir; C:\Puppet labs\ Puppet\puppet\lib; C:\Puppet Labs\puppet\facter\libdir


Second, the order

MCO Facts #使用fact信息显示报告 MCO Inventory #来自nodes \collectives\subcollectives Report Tool MCO Nettest #测试节点网络和连接 MCO    Nrpe #调用NRPE工具, return monitoring information MCO package #软件包的安装卸载升级 MCO plugin #MC插件 MCO puppet #管理puppet Agent MCO RPC #利用RPC程序进行交互 MCO service #管理系统服务

Third, filter

MCO RPC Service Status service=puppet-s "Environment=development" #-s can use and or! MCO Ping--with-agent Service #--with-agent or-A MCO ping--with-class Apache #--with-class or-C MCO p Ing-c/service/mco Ping--with-fact country=uk #--with-fact or-f MCO ping-i hostname01-i hostname02


Iv. Management

1. Verify Agent Plugin

    mco inventory puppetagent.ewin.com 
inventory for puppetagent.ewin.com:   server statistics:                        version: 2.8.1                    Start Time: Thu Apr 23 14:35:39 +0800 2015                   config  File: /etc/mcollective/server.cfg                   Collectives: mcollective               Main Collective: mcollective                    process id:  12301               total messages: 14       Messages Passed Filters: 14             Messages Filtered: 0              Expired Messages: 0                  Replies Sent: 13          Total Processor Time: 5.69 seconds                   system time: 1.8  seconds   Agents:      discovery        puppet          rpcutil               service            Data Plugins:      agent            collective      fact                  fstat            puppet          resource              service                                              configuration management classes:      no classes  applied   facts:      mcollective => 1 

The puppet instructions are listed under Data plugins to install the plugin successfully.

2. View Puppet status information

MCO Puppet Status
* [==========================================================>] 1/1 puppetagent.ewin.com:Currently stopped; Last completed run seconds agosummary of applying:false = 1Summary of Daemon running:stopped = 1Summary of Enable d:enabled = 1Summary of Idling:false = 1Summary of status:stopped = 1Finished processing 1/1 hosts in 70.91 ms

3, check the agent's puppet status

MCO RPC Puppet Status
* [ ==========================================================> ] 1 /  1puppetagent.ewin.com                               applying:  false   daemon running: false     lock message:           Enabled: true            Idling: false          last run: 1429771233          message:  Currently stopped; last completed run 1 minutes 18 seconds ago    Since Last Run: 78            status: stopped

4. Force all clients to run agent

MCO puppet Runonce-v
Discovering hosts using the mc method for 2 second (s)  .... 1  * [ ==========================================================> ] 1 /  1puppetagent.ewin.com                     : OK    {:initiated_at=>1429771209,      :summary=>       "Started a puppet run  using the  ' Puppet agent --onetime --no-daemonize --color=false --show _diff --verbose --splay --splaylimit 30 '  command '}---- rpc stats ----            Nodes: 1 / 1      Pass / Fail: 1 / 0      Start  Time: thu apr 23 14:40:13 +0800 2015  discovery time: 2004.83ms       agent time: 89.65ms      total time: 2094.48ms

5. forcing the specified client to run the agent

MCO puppet runonce-i Puppetagent.ewin.com-v


Five, Shell plug-in

The shell plugin can execute the client's shell commands remotely, for example:

MCO Shell "CAT/ETC/PASSWD | grep puppet "

Http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/InstallingPlugins


More plugins in:

Https://github.com/puppetlabs/mcollective-plugins

This article is from the "Moon Ching Xing Fei" blog, please be sure to keep this source http://ywzhou.blog.51cto.com/2785388/1754232

Puppet integration Foreman (vi): mcollective command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.