Module for returning various status data about a minion. These data can be useful for compiling into stats later.


Return a composite of all status data and info for this minion. Warning: There is a LOT here!

CLI 范例:

salt '*' status.all_status

Return the CPU info for this minion

CLI 范例:

salt '*' status.cpuinfo

Return the CPU stats for this minion

CLI 范例:

salt '*' status.cpustats

Return a custom composite of status data and info for this minion, based on the minion config file. An example config like might be:

status.cpustats.custom: [ 'cpu', 'ctxt', 'btime', 'processes' ]

Where status refers to, cpustats is the function where we get our data, and custom is this function It is followed by a list of keys that we want returned.

This function is meant to replace all_status(), which returns anything and everything, which we probably don't want.

By default, nothing is returned. Warning: Depending on what you include, there can be a LOT here!

CLI 范例:

salt '*' status.custom

Return the disk stats for this minion

CLI 范例:

salt '*' status.diskstats

Return the disk usage for this minion


salt '*' status.diskusage [paths and/or filesystem types]

CLI 范例:

salt '*' status.diskusage         # usage for all filesystems
salt '*' status.diskusage / /tmp  # usage for / and /tmp
salt '*' status.diskusage ext?    # usage for ext[234] filesystems
salt '*' status.diskusage / ext?  # usage for / and all ext filesystems

Return the load averages for this minion

CLI 范例:

salt '*' status.loadavg
salt.modules.status.master(master=None, connected=True)

2014.7.0 新版功能.

Fire an event if the minion gets disconnected from its master. This function is meant to be run via a scheduled job from the minion. If master_ip is an FQDN/Hostname, is must be resolvable to a valid IPv4 address.

CLI 范例:

salt '*' status.master

Return the memory info for this minion

CLI 范例:

salt '*' status.meminfo

Return the network device stats for this minion

CLI 范例:

salt '*' status.netdev

Return the network stats for this minion

CLI 范例:

salt '*' status.netstats

Return the number of processing units available on this system

CLI 范例:

salt '*' status.nproc

Return the PID or an empty string if the process is running or not. Pass a signature to use to find the process via ps. Note you can pass a Python-compatible regular expression to return all pids of processes matching the regexp.

CLI 范例:

salt '*' <sig>

Return the process data

CLI 范例:

salt '*' status.procs
salt.modules.status.time(format='%A, %d. %B %Y %I:%M%p')

2016.3.0 新版功能.

Return the current time on the minion, formated based on the format parameter.

Default date format: Monday, 27. July 2015 07:55AM

CLI 范例:

salt '*' status.time

salt '*' status.time '%s'

Return the uptime for this minion

human_readable: True

If True return the output provided by the system. If False return the output in seconds.

2015.8.4 新版功能.

CLI 范例:

salt '*' status.uptime

Return the system version for this minion

CLI 范例:

salt '*' status.version

Return the virtual memory stats for this minion

CLI 范例:

salt '*' status.vmstats

Return a list of logged in users for this minion, using the w command

CLI 范例:

salt '*' status.w