lib/riemann/babbler/plugin.rb in riemann-babbler-0.8.1 vs lib/riemann/babbler/plugin.rb in riemann-babbler-0.8.2
- old
+ new
@@ -66,10 +66,14 @@
event.delete(:as_diff)
report(event)
end
def get_hostname
- hostname = options.riemann.use_fqdn.nil? ? File.read('/proc/sys/kernel/hostname').strip.downcase : Socket.gethostbyname(Socket.gethostname).first
+ if options.riemann.use_fqdn.nil? || options.riemann.use_fqdn == false
+ hostname = File.read('/proc/sys/kernel/hostname').strip.downcase
+ else
+ hostname = Socket.gethostbyname(Socket.gethostname).first
+ end
if options.riemann.installation.nil?
hostname += options.riemann.suffix unless options.riemann.suffix.nil?
else
hostname += ( "." + options.riemann.installation )
end