Created
May 18, 2018 16:23
-
-
Save mikesavtechnology/5330bb0f0129d5b29a9b482311036b8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpenVPNAccessServer < Scout::Plugin | |
def build_report | |
user_output = JSON.parse(`sudo /usr/local/openvpn_as/scripts/sacli VPNSummary`) | |
license_output = `sudo /usr/local/openvpn_as/scripts/liman info`[5..-1] | |
license_output.gsub!("'", '"') | |
license_output.chomp! | |
license_output.downcase! | |
license_output = JSON.parse(license_output) | |
available_licenses = license_output["concurrent_connections"] - user_output["n_clients"] | |
report(:Connected => user_output["n_clients"], :Licensed => license_output["concurrent_connections"], :Available => available_licenses) | |
end | |
end |
havenwood
commented
May 23, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment