Now it's not needed to have also reports enabled in 'traffacct.pm' to generate daily traffic counters

This commit is contained in:
Jordi Sanfeliu 2016-05-20 10:15:12 +02:00
parent 832abfc664
commit 7cb0fadfdd
1 changed files with 7 additions and 5 deletions

View File

@ -683,7 +683,7 @@ while(1) {
} }
# TRAFFACCT graph daily reports # TRAFFACCT graph daily reports
if(lc($config{traffacct}->{enabled}) eq "y" && lc($config{traffacct}->{reports}->{enabled}) eq "y") { if(lc($config{traffacct}->{enabled}) eq "y"
my $d = "traffacct"; my $d = "traffacct";
undef($d) if(!grep {trim($_) eq $d} (@{$config{debug}})); undef($d) if(!grep {trim($_) eq $d} (@{$config{debug}}));
@ -697,10 +697,12 @@ while(1) {
} }
# send reports every first day of a month # send reports every first day of a month
if($mday == 1) { if(lc($config{traffacct}->{reports}->{enabled}) eq "y") {
eval { traffacct::traffacct_sendreports(\%config, $d); }; if($mday == 1) {
if($@) { eval { traffacct::traffacct_sendreports(\%config, $d); };
logger("traffacct::traffacct_sendreports(): $@"); if($@) {
logger("traffacct::traffacct_sendreports(): $@");
}
} }
} }
} }