1#!/usr/bin/perl -w 2 3# launched by crontab every 1 minute 4# start all pollers groups 5 6use strict; 7use Sys::Syslog; 8use Sys::Syslog qw(:DEFAULT setlogsock); 9 10my $conf_file="%CONFFILE%"; 11my $dir_bin="%BINDIR%"; 12 13require "%NMLIBDIR%/libmetro.pl"; 14 15my %config = read_global_conf_file($conf_file); 16 17# get pollers groups 18my @groupes = split(/,/,$config{pollergroups}); 19 20my $syslogfacility = $config{pollerlogfacility} ; 21 22# log message for starting of pollers 23writelog("metropoller-run", $syslogfacility, "info", 24 "\t #######################################"); 25 26my $i; 27for($i=0;$i<@groupes;$i++) 28{ 29 # get number of process for each poller group member 30 my $nb_process = $config{"gpnbproc_$groupes[$i]"}; 31 32 my $j; 33 for($j=1;$j<=$nb_process;$j++) 34 { 35 if(system("$dir_bin/metropoller $groupes[$i] $j $nb_process &") == 0) 36 { 37 writelog("metropoller-run",$config{pollerlogfacility},"info", 38 "\t -> STARTING metropoller group '$groupes[$i]' process $j of $nb_process"); 39 } 40 41 sleep(1); 42 } 43} 44