github / evenflow

sFlow to Graphite bridge
MIT License
18 stars 11 forks source link

Evenflow blows up on DNS failure. #2

Open imbriaco opened 10 years ago

imbriaco commented 10 years ago

If the source IP that is sending metrics to evenflow isn't in DNS, the process crashes. We should just ignore metrics from hosts that are not in DNS and emit a log line instead.

/usr/lib/ruby/1.8/resolv.rb:398:in `getname': DNS result has no information for 172.16.18.254 (Resolv::ResolvError)
        from ./evenflow.rb:66
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1037:in `call'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1037:in `spawn_threadpool'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1033:in `initialize'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1033:in `new'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1033:in `spawn_threadpool'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:1023:in `defer'
        from ./evenflow.rb:83
        from /data/evenflow/vendor/gems/ruby/1.8/gems/em-sflow-1.0.1/lib/em-sflow/datagram_handler.rb:25:in `call'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/em-sflow-1.0.1/lib/em-sflow/datagram_handler.rb:25:in `receive_data'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/em-sflow-1.0.1/lib/em-sflow/datagram_handler.rb:24:in `each'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/em-sflow-1.0.1/lib/em-sflow/datagram_handler.rb:24:in `receive_data'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
        from /data/evenflow/vendor/gems/ruby/1.8/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
        from ./evenflow.rb:10
Gug42 commented 10 years ago

Hello,

Stupid question about this : why ignore metrics ? Can push the metric with the IP without any DNS resolution ? Because here, most of the devices, doesn't have any reverse adresse translation ...

Thank you in advance.

Regards,

imbriaco commented 10 years ago

@Gug42 Evenflow uses the DNS hostname to construct the Graphite key to use for the metric. I suppose it could be changed to publish those metrics with IP addresses instead, but that doesn't fit the pattern it has used before.