Sha256: ef74229c79d9d81f81678ed1bba60d77867089098b2771e5dd6295975402c22f

Contents?: true

Size: 575 Bytes

Versions: 9

Compression:

Stored size: 575 Bytes

Contents

module Panoptimon
  module Collector
    class Socket
      class Unix < Panoptimon::Collector::Socket
        attr_accessor :query

        def initialize(options={})
          opt = super(defaults.merge(options))
          @query = opt[:query]
          opt
        end

        def defaults
          super.merge({
            path:    '/var/run/haproxy/stats',
            query:   'show info',
            timeout: 5
          })
        end

        def get_banner
          UNIXSocket.new(@path).puts(query).readlines.join('')
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
panoptimon-0.4.5 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.4.4 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.4.2 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.4.1 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.4.0 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.3.0 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.2.0 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.1.0 collectors/socket/lib/panoptimon-collector-socket/unix.rb
panoptimon-0.0.2 collectors/socket/lib/panoptimon-collector-socket/unix.rb