This file contains hidden or 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
#!/usr/local/bin/ruby | |
# とりあえずこのへんをグラフ化 | |
# ●インデックス | |
# numDocs | |
# サイズ | |
# | |
# ●検索クエリ | |
# 総リクエスト(QPS) | |
# エラー(QPS) | |
# タイムアウト(QPS) |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
//最新版だとPHP5.2~らしいのでSDKは1.3.0を使う | |
require_once(dirname(__FILE__) .'/../helper/aws/sdk-1.3.0/sdk.class.php'); | |
//error_reporting(E_ALL); | |
$debug_log = "/var/log/zabbix/rds.log"; | |
//$args = print_r($argv, true); | |
//debug_log($args); |
This file contains hidden or 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
define command{ | |
command_name notify-service-by-spreadsheet | |
command_line /etc/nagios/notify-service-by-spreadsheet.rb "$HOSTALIAS$" "$SERVICESTATE$" "$NOTIFICATIONTYPE$" "$SERVICEDESC$" "$SERVICEOUTPUT$" "$TIMET$" | |
} | |
define contact{ | |
name generic-contact | |
service_notification_period 24x7 | |
host_notification_period 24x7 | |
service_notification_options w,u,c,r,f,s |
This file contains hidden or 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
#!/home/mikeda/.rbenv/shims/ruby | |
# -*- coding: utf-8 -*- | |
require 'google_drive' | |
session = GoogleDrive.login("<user>@gmail.com", "<password>") | |
#session.files.each do |file| | |
# p file.title | |
#end |
This file contains hidden or 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
module Fluent | |
class RecommendRedis < Output | |
Fluent::Plugin.register_output('recommend_and_ranking', self) | |
require 'redis' | |
REDIS = Redis.new(:host => "192.168.1.126", :port => 6379) | |
VIEW_PREFIX = 'view_' # ユーザごとの閲覧履歴のリスト | |
RELATION_PREFIX = 'relation_' # アイテム間の相関値 | |
ACCESS_COUNTER = 'access_counter' # アイテムごとのアクセスカウンタ |
This file contains hidden or 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
<Proxy balancer://3sec/ > | |
BalancerMember http://192.168.1.1 loadfactor=10 timeout=3 | |
BalancerMember http://192.168.1.2 loadfactor=10 timeout=3 | |
</Proxy> | |
<Proxy balancer://5sec/ > | |
BalancerMember http://192.168.1.1 loadfactor=10 timeout=5 | |
BalancerMember http://192.168.1.2 loadfactor=10 timeout=5 | |
</Proxy> |
This file contains hidden or 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
#!/usr/local/bin/ruby | |
# ログの差分出力スクリプト | |
# 使用例 | |
# 前回実行からの追記分を出力する | |
# $ logtail.rb access_log | |
# | |
# ログのローテートに対応させる場合はオプションでローテートファイルを指定する | |
# $ logtail.rb access_log -r access_log.1 | |
# |
This file contains hidden or 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
#!/bin/bash | |
### 使い方 | |
### アラート停止:nagios_alert.sh stop web01 db01 | |
### アラート再開:nagios_alert.sh start web01 db01 | |
command_file="/var/spool/nagios/cmd/nagios.cmd" | |
if [ $# -lt 2 ];then | |
echo "usage: $0 <start|stop> hosts1 host2 ..." |
This file contains hidden or 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
#!/usr/local/bin/ruby | |
# -*- encoding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
require 'pp' | |
configs = [ | |
{ desc: '正常', url: 'http://mikeda.jp/wiki/', regex: /MikedaWiki/, timeout: 1}, | |
{ desc: '中身がおかしい', url: 'http://mikeda.jp/wiki/', regex: /XXXYYYZZZ/, timeout: 1}, |
This file contains hidden or 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
#!/bin/env ruby | |
# -*- encoding: utf-8 -*- | |
require 'growthforecast' | |
SERVICE = 'service01' | |
SECTION = 'access' | |
COMPLEX_GRAPHS = [ | |
{ | |
name: 'access_status', |