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