Skip to content

Commit

Permalink
inventory: add openrw usage informations
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 23, 2024
1 parent b9d26be commit cb4fadf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nethsec/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ def fact_openvpn_tun(uci: EUci):
ret["server"] += 1
return ret

def fact_openvpnrw_informations(uci: EUci):
ret = {}
for section in utils.get_all_by_type(uci, 'openvpn', 'openvpn'):
vpn = uci.get_all("openvpn", section)
if not section.startswith('ns_'):
continue
ret[section] = {}
if "ns_auth_mode" in vpn:
ret[section]["auth_mode"] = vpn.get('ns_auth_mode')
if "ns_user_db" in vpn:
ret[section]["ns_user_db"] = vpn.get('ns_user_db')
return ret

def fact_subscription_status(uci: EUci):
return { 'status': uci.get('ns-plug', 'config', 'type', default='no') }

Expand Down

0 comments on commit cb4fadf

Please sign in to comment.