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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Data::Dumper; | |
use ZabbixAPI; | |
my $user = "<user>"; | |
my $password = "<password>"; |
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
#<source> | |
# type mysql_query | |
# log /var/log/mysqld/query.log | |
#</source> | |
# TODO:複数行クエリ対応 | |
# TODO:余計なクエリの除外せねば | |
# TODO:タイムスタンプをログから取得するように | |
# TODO:ログイン後にuseされると接続DBがわからない | |
# TODO:タグ名を変数にしないと | |
# TODO:td-agent停止時にtailプロセスをkillできてない |
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
#指定ディレクトリ下のファイル操作を監視する | |
# | |
#config | |
#<source> | |
# type inotify | |
# tag inotify.log | |
# dir /tmp/inotify_test_d/ | |
#</source> | |
# | |
#emit |
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
#@config | |
#<source> | |
# type mytail | |
# format apache | |
# path /var/log/httpd/access_log | |
# tag apache.access | |
# to_i size,code | |
#</source> | |
module Fluent |
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
# datacounterと連携させるときにアイテム、グラフ、スクリーン作りまくるのが面倒だから | |
# テンプレート化できるようにに変換する | |
# host:webservice, key:site1_2xx_count | |
# => host:webservice_site1, key:2xx_count | |
module Fluent | |
class ZabbixExtOutput < ZabbixOutput | |
Fluent::Plugin.register_output('zabbix_ext', self) | |
config_param :split_host, :bool, :default => false |
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
#!/bin/bash | |
MONITOR_DIR="/tmp/js" | |
OUTPUT_DIR="/tmp/min-js" | |
YUIC_JAR="~/tool/yuicompressor/build/yuicompressor-2.4.7.jar" | |
YUIC_OPTS="--charset utf-8" | |
inotifywait -m -e modify --format %w%f -r $MONITOR_DIR | egrep --line-buffered '\.(js|css)$' | \ | |
while read js;do | |
min_js=`echo $js | sed "s|$MONITOR_DIR|$OUTPUT_DIR|"` |
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
<match forward.mail.rcv> | |
type rewrite_tag_filter | |
rewriterule1 to @blog\.mikeda\.jp$ filtered.mail.rcv.blog | |
rewriterule2 to @mikeda\.jp$ filtered.mail.rcv.main | |
rewriterule3 to @wiki\.crooz\.jp$ filtered.mail.rcv.wiki | |
</match> |
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
#TODO | |
# package周り調整 | |
# ディスク部分を外出しできるように。CentOS6で%ksappendがうまく動かなくて全部ベタ書きになってる | |
install | |
text | |
url --url=http://192.168.1.10/mrepo/centos6-x86_64/disc1/ | |
lang ja_JP.UTF-8 | |
keyboard jp106 | |
network --onboot yes --device eth0 --bootproto dhcp --noipv6 |
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
#コーディング時間5分。書き始める前に他の作業しながらある程度考えてた | |
$ for i in {0..100};do if [ $((i%15)) -eq 0 ];then echo FizzBuzz;elif [ $((i%3)) -eq 0 ];then echo Fizz;elif [ $((i%5)) -eq 0 ];then echo Buzz;else echo $i;fi;done |
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
# Dumper(RRDs::info "/var/lib/munin/test01/test01-cpu-user-d.rrd")の抜粋 | |
# けっきょくのところ | |
# 300秒ごとに監視。保存設定は以下4つ | |
# 1. 2日間、そのまま保存 | |
# 2. 9日間、6回(30分)ごとのサマリで保存 | |
# 3. 45日間、24回(2時間)ごとのサマリで保存 | |
# 4. 450日間、288回(24時間)ごとのサマリで保存 | |
$VAR1 = { | |
# 全体情報 |
OlderNewer