Skip to content

Commit 3a40447

Browse files
committed
YAML::Syckにした
1 parent cab7bca commit 3a40447

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Makefile.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ requires 'Text::MicroTemplate';
2424
requires 'Gearman::Client', 1.10;
2525
requires 'Gearman::Server';
2626
requires 'Parallel::Prefork', 0.08;
27-
requires 'YAML', 0.71;
27+
requires 'YAML::Syck', 1.10;
2828
requires 'Starlet', 0.08;
2929
requires 'Filesys::Notify::Simple';
3030
requires 'Proc::Daemon';

cloudforecast_sample.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
config:
3-
# gearman$B$rMxMQ$9$k>l9g!"(Benable$B$r(B1$B$K$7$F!"(Bgermand$B$N(Bhost$BL>$H(Bport$B$r;XDj$7$^$9(B
3+
# gearmanを利用する場合、enableを1にして、germandのhost名とportを指定します
44
gearman_enable: 0
55
gearman_server:
66
host: localhost
77
port: 7003
8-
# rrd$B$N%U%!%$%k$r@_CV$9$k>l=j!#!V(B/$B!W$+$i;O$^$k$H@dBP%Q%9$H$J$j$^$9(B
8+
# rrdのファイルを設置する場所。「/」から始まると絶対パスとなります
99
data_dir: data
10-
# $B4F;k9`L\$N@_Dj%U%!%$%k$r@_CV$9$k%G%#%l%/%H%j!#!V(B/$B!W$+$i;O$^$k$H@dBP%Q%9(B
10+
# 監視項目の設定ファイルを設置するディレクトリ。「/」から始まると絶対パス
1111
host_config_dir: host_config
1212

1313
component_config:
14-
# SNMP$B$G%G!<%?$r<hF@$9$k;~$N%*%W%7%g%s!#(Bcommunity$B$H(Bversion
14+
# SNMPでデータを取得する時のオプション。communityとversion
1515
SNMP:
1616
community: public
1717
version: 2
18-
# MySQL$B$r4F;k$9$k>l9g$N(Buser$BL>$H%Q%9%o!<%I(B
18+
# MySQLを監視する場合のuser名とパスワード
1919
MySQL:
2020
user: root
2121
password: ""

lib/CloudForecast/ConfigLoader.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use strict;
44
use warnings;
55
use base qw/Class::Accessor::Fast/;
66
use Path::Class qw//;
7-
use YAML qw//;
7+
use YAML::Syck qw//;
88
use Cwd;
99
use Filesys::Notify::Simple;
1010
use CloudForecast::Log;
@@ -41,10 +41,10 @@ sub load_yaml {
4141
my @data;
4242
eval {
4343
if ( ref $file ) {
44-
@data = YAML::Load($$file);
44+
@data = YAML::Syck::Load($$file);
4545
}
4646
else {
47-
@data = YAML::LoadFile($file);
47+
@data = YAML::Syck::LoadFile($file);
4848
}
4949
die "no yaml data in $file" unless @data;
5050
};

server_list_sample.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- #Dev
2-
# --- #Hoge$B$H=q$/$3$H$G%5!<%P0lMw$r6h@Z$k$3$H$,$G$-$^$9(B
3-
# config$B$O(Bhost_config$BFb$N4F;k9`L\$N@_Dj%U%!%$%kL>(B
4-
# hosts$B$O(B $B!V(BIP$B%"%I%l%9(B[space]$B%[%9%HL>(B[space]$B%3%a%s%H!W$G$9!#%3%a%s%HFb$K$O%9%Z!<%9$,$"$C$F$b$+$^$$$^$;$s(B
2+
# --- #Hogeと書くことでサーバ一覧を区切ることができます
3+
# configはhost_config内の監視項目の設定ファイル名
4+
# hostsは 「IPアドレス[space]ホスト名[space]コメント」です。コメント内にはスペースがあってもかまいません
55
servers:
66
- config: basic.yaml
77
hosts:

0 commit comments

Comments
 (0)