Top Level Namespace

Defined Under Namespace

Modules: GitoriousMuninPlugins

Constant Summary collapse

ProxyPid =
home + "../run/git-proxy-1.pid"
Pid =
config.gitorious_home + "tmp/pids/poller0.pid"
GitoriousConfig =
config.gitorious_config
Directories =
{
  "cache_dir" => GitoriousConfig["archive_cache_dir"],
  "working_dir" => GitoriousConfig["archive_work_dir"],
  "repo_root" => GitoriousConfig["repository_base_path"]
}

Instance Method Summary collapse

Instance Method Details

#disk_usage(key) ⇒ Object



8
9
10
11
12
# File 'lib/gitorious-munin-plugins/plugins/gitorious_disk_usage.rb', line 8

def disk_usage(key)
  dir = Directories[key]
  command = "du -sb #{dir} 2>/dev/null"
  result = `#{command}`.split(/\s+/).first
end

#ps_outputObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitorious-munin-plugins/plugins/git_proxy.rb', line 5

def ps_output
if ProxyPid.exist?
  cmd = "ps ww `cat #{ProxyPid}` | egrep -v '(ps|PID)'"
  res = `#{cmd}`.strip
  if res =~ /\-\ (\d+)\/(\d+)\/(\d+)\ cur\/max\/tot\ conns$/
    curr, max, total = $1, $2, $3
    puts "curr.value #{curr}"
    puts "max.value #{max}"
    puts "total.value #{total}"
  end
else
  $stderr.puts "#{ProxyPid} not found"
end

end