Hi
I have tried to monitor the size of a subdirectory using fileinfo and realized that the perl program inside the check_mk_agent prints nothing in case of directories:
my $file_stats = "";
foreach (@patterns) {
foreach (bsd_glob("$_")) {
if (! -f) {
$file_stats .= "$_|missing\n" if ! -d;
} elsif (my @infos = stat) {
$file_stats .= "$_|ok|$infos[7]|$infos[9]\n";
} else {
$file_stats .= "$_|stat failed: $!\n";
}
}
}
These two lines
if (! -f) {
$file_stats .= "$_|missing\n" if ! -d;
should be changed into
if (! -f && ! -d) {
$file_stats .= "$_|missing\n";
Is this made on purpose?