mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
make status.vmstats work on Solaris like platforms and OpenBSD
This commit is contained in:
parent
805171c949
commit
81d7fc98d8
1 changed files with 7 additions and 3 deletions
|
@ -522,6 +522,7 @@ def diskusage(*args):
|
|||
|
||||
def vmstats():
|
||||
'''
|
||||
..versionchanged:: 2016.3.2
|
||||
Return the virtual memory stats for this minion
|
||||
|
||||
CLI Example:
|
||||
|
@ -546,9 +547,10 @@ def vmstats():
|
|||
ret[comps[0]] = _number(comps[1])
|
||||
return ret
|
||||
|
||||
def freebsd_vmstats():
|
||||
def generic_vmstats():
|
||||
'''
|
||||
freebsd specific implementation of vmstats
|
||||
generic implementation of vmstats
|
||||
note: works on FreeBSD, SunOS and OpenBSD (possibly others)
|
||||
'''
|
||||
ret = {}
|
||||
for line in __salt__['cmd.run']('vmstat -s').splitlines():
|
||||
|
@ -559,7 +561,9 @@ def vmstats():
|
|||
# dict that returns a function that does the right thing per platform
|
||||
get_version = {
|
||||
'Linux': linux_vmstats,
|
||||
'FreeBSD': freebsd_vmstats,
|
||||
'FreeBSD': generic_vmstats,
|
||||
'OpenBSD': generic_vmstats,
|
||||
'SunOS': generic_vmstats,
|
||||
}
|
||||
|
||||
errmsg = 'This method is unsupported on the current operating system!'
|
||||
|
|
Loading…
Add table
Reference in a new issue