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/perl | |
| use strict; | |
| use warnings; | |
| use RRDs; | |
| use Data::Dumper; | |
| #ホストのリストをどこから取ってくるか・・・ | |
| my $hostname = 'test01'; | |
| my @rrds = ( |
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/lib64/fluent/ruby/bin/ruby | |
| # -*- encoding: utf-8 -*- | |
| # GrowthForecastのAPIを使って複合グラフを作るサンプル | |
| # 仕様はこのへん読もう | |
| # https://github.com/kazeburo/GrowthForecast/blob/master/lib/GrowthForecast/Web.pm | |
| # | |
| # <service_name>/access/{2xx_count,3xx_count,4xx_count,5xx_count} | |
| # ↓ | |
| # <service_name>/access/access_status |
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
| $ModLoad imuxsock | |
| $ModLoad imklog | |
| $ModLoad imudp | |
| $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | |
| $template RemoteLog, "/var/log/remote/%hostname:::secpath-replace%/%hostname:::secpath-replace%_%$year%%$month%%$day%.log" | |
| $RuleSet local | |
| *.info;mail.none;authpriv.none;cron.none /var/log/messages | |
| authpriv.* /var/log/secure |
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/perl | |
| use strict; | |
| use warnings; | |
| use Data::Dumper; | |
| my $command = 'nodetool -h localhost tpstats'; | |
| my $prefix = "cassandra_task_"; | |
| my @graphs = qw(active pending completed); | |
| my %configs = ( |
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
| user nginx; | |
| worker_processes 1; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } |
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/perl -w | |
| # -*- cperl -*- | |
| use strict; | |
| use Munin::Plugin; | |
| use Munin::Plugin::SNMP; | |
| my $response; | |
| my $iface; | |
| my $alias; |
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', |
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/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 | |
| # ログの差分出力スクリプト | |
| # 使用例 | |
| # 前回実行からの追記分を出力する | |
| # $ logtail.rb access_log | |
| # | |
| # ログのローテートに対応させる場合はオプションでローテートファイルを指定する | |
| # $ logtail.rb access_log -r access_log.1 | |
| # |