Mine combining Cmd.run Custom collection system Information

Source: Internet
Author: User

Mine this module as if the official website did not say that the specific can achieve what function, specifically, the data can be re-client in real time in accordance with our requirements to refresh, this is not to meet our requirements to monitor the status of the client, mentioned earlier grains is to restart salt-minion to take effect.

Start to achieve:

1. Service-side operation:

[Email protected] python]# cd/etc/salt/minion.d/

[email protected] minion.d]# cat mine.conf
Mine_functions: #调用mine函数
Test.ping: [] #调用test. Ping module, of course, can also disk.usage: [], self-flexible application
Cmd.run: #自定义cmd. Run command to generate data
-Date;df-h;uptime
Mine_interval:1 #每一秒刷新一次

2, so that we can according to their own definition to collect the client, the CPU is responsible, and so on some information, the following push to the client;

3, salt-cp ' * ' mine.conf/etc/salt/minion.d/

4, salt ' * ' cmd.run '/etc/init.d/salt-minion restart ' Restart the client

To perform the viewing effect:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/59/E4/wKioL1Tuyt2DzfWXAAJOOMShd_s395.jpg "title=" Mine using the. png "alt=" wkiol1tuyt2dzfwxaajoomshd_s395.jpg "/>

See the effect of performing each refresh is not the same, do the monitoring can start from this, today is recorded here.

This article is from the "Little Luo" blog, please be sure to keep this source http://xiaoluoge.blog.51cto.com/9141967/1615453

Mine combining Cmd.run Custom collection system Information

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.