X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c18698a0522cfe2ede5361706cf59d99b9cb55de..2bfb0ef07fb64314f5c4ded641a8c280df9c1d0b:/cookbooks/munin/files/default/plugins/api_calls_status?ds=sidebyside diff --git a/cookbooks/munin/files/default/plugins/api_calls_status b/cookbooks/munin/files/default/plugins/api_calls_status index 16b0d0e03..4a9623f9b 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_status +++ b/cookbooks/munin/files/default/plugins/api_calls_status @@ -4,6 +4,7 @@ require "json" HTTP_STATUSES = { "200" => "OK", + "206" => "Partial Content", "301" => "Moved Permanently", "302" => "Found", "303" => "See Other", @@ -12,27 +13,34 @@ HTTP_STATUSES = { "401" => "Unauthorized", "403" => "Forbidden", "404" => "Not Found", + "405" => "Method Not Allowed", "408" => "Request Timeout", "409" => "Conflict", "410" => "Gone", + "412" => "Precondition Failed", + "416" => "Requested Range Not Satisfiable", + "422" => "Unprocessable Entity", "500" => "Internal Server Error", + "502" => "Bad Gateway", + "503" => "Service Unavailable", "509" => "Bandwidth Limit Exceeded" -} +}.freeze if ARGV[0] == "config" puts "graph_title HTTP response codes" - puts "graph_args --lower-limit 0 --base 1000 --logarithmic" + puts "graph_args --base 1000" puts "graph_vlabel Number of requests per ${graph_period}" puts "graph_category api" HTTP_STATUSES.each do |code, label| - puts "http#{code}.label #{label}" + puts "http#{code}.label #{code} #{label}" puts "http#{code}.type DERIVE" + puts "http#{code}.min 0" end else statistics = JSON.parse(File.read("/srv/www.openstreetmap.org/rails/tmp/statistics.json")) - HTTP_STATUSES.keys.each do |code| + HTTP_STATUSES.each_key do |code| count = statistics["status"][code] || 0 puts "http#{code}.value #{count}" end