This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'stats' |nc localhost 11211 | |
echo 'flush_all' |nc localhost 11211 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# mackrel-client-ruby 0.0.2 使用 | |
require 'mackerel' | |
client = Mackerel::Client.new(:mackerel_api_key => ENV['MACKEREL_APIKEY']) | |
client.get_hosts(service: 'service_name').each do |host| | |
# working以外で初期登録から一週間以上経過している | |
if host.status != "working" && host.createdAt < Time.now.to_i - (60 * 60 * 24 * 7) | |
p "retire host id:#{host.id}" | |
p client.retire_host(host.id) |
NewerOlder