Sha256: 3b6d6127de6b5ca8ba65ad051d467ea6d35f75c80871abf05c869f1180495503

Contents?: true

Size: 739 Bytes

Versions: 12

Compression:

Stored size: 739 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path('../../lib/riemann/tools', __FILE__)

class Riemann::Tools::FreeSWITCH
  include Riemann::Tools

  def tick

  #determine how many current calls I have according to FreeSWITCH
  fs_calls = %x[fs_cli -x "show calls count"| grep -Po '^\\d+']
  
  #determine how many current channels I have according to FreeSWITCH
  fs_channels = %x[fs_cli -x "show channels count"| grep -Po '^\\d+']

  #submit them to riemann
  report(
     :service => "FreeSWITCH current calls",
     :metric => fs_calls.to_i,
     :state => "info"
       )

  report(
     :service => "FreeSWITCH current channels",
     :metric => fs_channels.to_i,
     :state => "info"
       )
  end
end

Riemann::Tools::FreeSWITCH.run

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
riemann-tools-0.2.2 bin/riemann-freeswitch
riemann-tools-0.2.1 bin/riemann-freeswitch
riemann-tools-0.2.0 bin/riemann-freeswitch
riemann-tools-0.1.9 bin/riemann-freeswitch
riemann-tools.haf-0.1.9 bin/riemann-freeswitch
riemann-tools-0.1.8 bin/riemann-freeswitch
riemann-tools-0.1.7 bin/riemann-freeswitch
riemann-tools-0.1.6 bin/riemann-freeswitch
riemann-tools-0.1.5 bin/riemann-freeswitch
riemann-tools-0.1.4 bin/riemann-freeswitch
riemann-tools-0.1.3 bin/riemann-freeswitch
riemann-tools-0.1.2 bin/riemann-freeswitch