bin/metrics-openvpn.rb in sensu-plugins-openvpn-0.0.2 vs bin/metrics-openvpn.rb in sensu-plugins-openvpn-0.0.3
- old
+ new
@@ -94,26 +94,26 @@
long: '--service SERVICE',
default: 'main'
def run
# Are these options overriden locally in .json?
- if defined? settings['openvpn-metrics']['host']
- def_host = settings['openvpn-metrics']['host']
- else
- def_host = config[:host]
- end
+ def_host = if defined? settings['openvpn-metrics']['host']
+ settings['openvpn-metrics']['host']
+ else
+ config[:host]
+ end
- if defined? settings['openvpn-metrics']['port']
- def_port = settings['openvpn-metrics']['port']
- else
- def_port = config[:port]
- end
+ def_port = if defined? settings['openvpn-metrics']['port']
+ settings['openvpn-metrics']['port']
+ else
+ config[:port]
+ end
- if defined? settings['openvpn-metrics']['service']
- def_service = settings['openvpn-metrics']['service']
- else
- def_service = config[:service]
- end
+ def_service = if defined? settings['openvpn-metrics']['service']
+ settings['openvpn-metrics']['service']
+ else
+ config[:service]
+ end
# collect data
# telnet into admin interface
vpn = Net::Telnet.new('Host' => def_host,
'Port' => def_port,