This file contains 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 | |
SACLI_SCRIPT = 'sudo /usr/local/openvpn_as/scripts/sacli VPNSummary' | |
LIMAN_SCRIPT = 'sudo /usr/local/openvpn_as/scripts/liman info' | |
def build_report | |
connected = user_output['n_clients'] | |
licensed = license['concurrent_connections'] | |
available = connected - licensed | |
report connected: connected, licensed: licensed, available: available |
This file contains 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
SyntaxError: (irb):2: unknown regexp options - lcal | |
(irb):2: syntax error, unexpected tCONSTANT, expecting keyword_do or '{' or '(' | |
from /usr/bin/irb:12:in `<main>' |
This file contains 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
root@openvpnas2:/usr/local/openvpn_as/scripts# cat /usr/local/openvpn_as/scripts/sacli | |
#!/usr/bin/env bash | |
if [ -z "$OPENVPN_AS_NOEXPORT" ]; then | |
export PYOVPN_VERSION="2.1.6" | |
export OPENVPN_AS_BASE="/usr/local/openvpn_as" | |
export OPENVPN_AS_CONFIG="/usr/local/openvpn_as/etc/as.conf" | |
export PATH="/usr/local/openvpn_as/scripts:/usr/local/openvpn_as/bin:/usr/local/openvpn_as/sbin:$PATH" | |
export LD_LIBRARY_PATH="/usr/local/openvpn_as/lib" | |
export PYTHONHOME="/usr/local/openvpn_as" | |
fi |
This file contains 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
#!/usr/bin/env bash | |
if [ -z "$OPENVPN_AS_NOEXPORT" ]; then | |
export PYOVPN_VERSION="2.1.6" | |
export OPENVPN_AS_BASE="/usr/local/openvpn_as" | |
export OPENVPN_AS_CONFIG="/usr/local/openvpn_as/etc/as.conf" | |
export PATH="/usr/local/openvpn_as/scripts:/usr/local/openvpn_as/bin:/usr/local/openvpn_as/sbin:$PATH" | |
export LD_LIBRARY_PATH="/usr/local/openvpn_as/lib" | |
export PYTHONHOME="/usr/local/openvpn_as" | |
fi | |
export PYOVPN_CMDNAME="sacli" |
This file contains 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
JSON::ParserError: A JSON text must at least contain two octets! | |
/usr/lib/ruby/1.9.1/json/common.rb:148:in `initialize' | |
/usr/lib/ruby/1.9.1/json/common.rb:148:in `new' | |
/usr/lib/ruby/1.9.1/json/common.rb:148:in `parse' | |
OpenVPNAS_License:3:in `build_report' | |
/usr/share/scout/ruby/scout-client/lib/scout/plugin.rb:222:in `run' | |
/usr/share/scout/ruby/scout-client/lib/scout/server.rb:487:in `block in process_plugin' | |
/usr/lib/ruby/1.9.1/timeout.rb:69:in `timeout' | |
/usr/share/scout/ruby/scout-client/lib/scout/server.rb:486:in `process_plugin' | |
/usr/share/scout/ruby/scout-client/lib/scout/server.rb:329:in `block in run_plugins_by_plan' |
This file contains 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) |