Sha256: 1087aa67c5a90e0bde4bcbdcc727608860e4ac6469dc5a8da4ea84fa5a5f7f55

Contents?: true

Size: 401 Bytes

Versions: 1

Compression:

Stored size: 401 Bytes

Contents

module Remon
  module Metrics
    class Salt

      def initialize(timeout: 240)
        @timeout = timeout
      end

      def status
        script = File.expand_path("#{__dir__}/../scripts/salt-status")
        out = `ruby #{script} #{@timeout} 2>/dev/null`
        output = out.chomp.split(":")
        { state: output[0], ok: output[1].to_i, total: output[2].to_i }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
remon-0.1.0 lib/remon/metrics/salt.rb