Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riemann-freeswitch sends number of threads used by Freeswitch #118

Merged
merged 1 commit into from
Jul 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bin/riemann-freeswitch
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class Riemann::Tools::FreeSWITCH
fs_pid = -666
end

fs_threads = fs_pid > 0 ? %x[ps huH p #{fs_pid} | wc -l].to_i : 0

# Submit calls to riemann
if fs_calls > @limits[:calls][:critical]
alert "FreeSWITCH current calls", :critical, fs_calls, "Number of calls are #{fs_calls}"
Expand Down Expand Up @@ -92,6 +94,11 @@ class Riemann::Tools::FreeSWITCH
alert "FreeSWITCH current conferences", :ok, fs_conferences, "Number of conferences are #{fs_conferences}"
end

# Submit threads to riemann
if fs_threads
alert "FreeSWITCH current threads", :ok, fs_threads, "Number of threads are #{fs_threads}"
end

# Submit status to riemann
if dead_proc?(fs_pid)
alert "FreeSWITCH status", :critical, -1, "FreeSWITCH service status: not running"
Expand Down