mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #44914 from jasperla/status/openbsd/netstat
status.netstats: add OpenBSD support
This commit is contained in:
commit
a1483af113
@ -1102,6 +1102,9 @@ def netstats():
|
||||
.. versionchanged:: 2016.11.4
|
||||
Added support for AIX
|
||||
|
||||
.. versionchanged:: Oxygen
|
||||
Added support for OpenBSD
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -1139,15 +1142,18 @@ def netstats():
|
||||
return ret
|
||||
|
||||
def freebsd_netstats():
|
||||
return bsd_netstats()
|
||||
|
||||
def bsd_netstats():
|
||||
'''
|
||||
freebsd specific netstats implementation
|
||||
bsd specific netstats implementation
|
||||
'''
|
||||
ret = {}
|
||||
for line in __salt__['cmd.run']('netstat -s').splitlines():
|
||||
if line.startswith('\t\t'):
|
||||
continue # Skip, too detailed
|
||||
if not line.startswith('\t'):
|
||||
key = line.split()[0]
|
||||
key = line.split()[0].replace(':', '')
|
||||
ret[key] = {}
|
||||
else:
|
||||
comps = line.split()
|
||||
@ -1207,7 +1213,8 @@ def netstats():
|
||||
# dict that returns a function that does the right thing per platform
|
||||
get_version = {
|
||||
'Linux': linux_netstats,
|
||||
'FreeBSD': freebsd_netstats,
|
||||
'FreeBSD': bsd_netstats,
|
||||
'OpenBSD': bsd_netstats,
|
||||
'SunOS': sunos_netstats,
|
||||
'AIX': aix_netstats,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user