Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cloudforecast_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ config:
data_dir: data
# 監視項目の設定ファイルを設置するディレクトリ。「/」から始まると絶対パス
host_config_dir: host_config
# radarの実行間隔(秒)
interval: 300

component_config:
# SNMPでデータを取得する時のオプション。communityとversion
Expand Down
5 changes: 3 additions & 2 deletions lib/CloudForecast/Radar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ sub run {
}

my $now = time;
my $next = $now - ( $now % 300 ) + 300;
my $interval = $global_config->{interval} || 300;
my $next = $now - ( $now % $interval ) + $interval;
my $pid;

my @signals_received;
Expand Down Expand Up @@ -76,7 +77,7 @@ sub run {
$now = time;
if ( $now >= $next ) {
CloudForecast::Log->warn( sprintf( "(%s) radar start ", scalar localtime $next) );
$next = $now - ( $now % 300 ) + 300;
$next = $now - ( $now % $interval ) + $interval;

if ( $pid ) {
CloudForecast::Log->warn( "Previous radar exists, skipping this time");
Expand Down