Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Saltstack remote execution command

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to use Saltstack remote execution commands. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Command

Command format:

Salt'[parameters]

Example:

Salt 'wx' cmd.run' free-m'# View the common parameters of the memory usage of the controlled host

Saltstack provides a variety of methods to filter the controlled host (id). The following lists the specific parameters commonly used:

-Emam Murray pcre, which is matched by regular expressions:

Salt-E'^ SN2013.*' test.ping # detects whether the host id name beginning with SN2013 is connected

-Lmam id list, which is filtered in the form of a list of host id names, in a format similar to that of Python, that is, different host id names are separated by commas.

Salt-L 'SN2013-08-021 grains.item osfullname # obtains the host id as: SN2013-08-021 SN2013-08-021 complete operating system release name

-Gmam Murphy, which performs matching filtering based on the grains information of the controlled host. The format is as follows:

Salt-G 'osrelease:6.4' cmd.run' python-V' # get the python version number with release number 6.4

-Imam Murray pillar, which is matched and filtered according to the pillar information of the controlled host. The format is: "object name": "object value".

The salt-I 'nginx:root:/data' test.ping # probe has connectivity of' nginx:root:/data' information. # pillar attribute configuration file is as follows: nginx: root: / data

-Nmam talk master nodegroup, which is filtered according to the grouping name in the configuration file of the master console.

Salt-C'e @ ^ SN2013. * and Grouostest.ping Centos` detects the connectivity of hosts with the beginning of SN2013 and operating system version CentOS

-Smam Murmuripcidr, matching according to the IP address or IP subnet of the host under control.

Salt-S 192.168.0.0 test.ping 16 test.pingsalt-S 192.168.1.10 Thank you for reading! This is the end of this article on "how to use Saltstack remote execution commands". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report