mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
Print missing files and change log_file to logfile
This commit is contained in:
parent
20425562c9
commit
21aedb1e7a
@ -5923,13 +5923,25 @@ sub cli_get_bad_conf_files() {
|
|||||||
foreach my $file (@files) {
|
foreach my $file (@files) {
|
||||||
# Check important tokens
|
# Check important tokens
|
||||||
my $missings = 0;
|
my $missings = 0;
|
||||||
my @tokens = ("server_ip","server_path","temporal","log_file");
|
my @tokens = ("server_ip","server_path","temporal","logfile");
|
||||||
|
|
||||||
if ($file !~ /.srv./) {
|
if ($file !~ /.srv./) {
|
||||||
foreach my $token (@tokens) {
|
foreach my $token (@tokens) {
|
||||||
if(enterprise_hook('pandora_check_conf_token',[$conf->{incomingdir}.'/conf/'.$file, $token]) == 0) {
|
my $result = enterprise_hook('pandora_check_conf_token', [$conf->{incomingdir}.'/conf/'.$file, $token]);
|
||||||
|
|
||||||
|
if($result == 0) {
|
||||||
$missings++;
|
$missings++;
|
||||||
}
|
}
|
||||||
|
elsif ($result == -1) {
|
||||||
|
print_log "[WARN] File not exists /conf/".$file."\n\n";
|
||||||
|
$bad_files++;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
elsif(!defined $result) {
|
||||||
|
print_log "[WARN] Can't open file /conf/".$file."\n\n";
|
||||||
|
$bad_files++;
|
||||||
|
last;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# If any token of checked is missed we print the file path
|
# If any token of checked is missed we print the file path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user