Check cumulative size of all the *.log files in a folder
Check cumulative size of all the *.log files in a folder
Hi Community,
Is it possible to check the cumulative size of all the *.log files in a folder?
There are 30 files in the folder - 20 of them are ".log" files.
I would like to be notified if all 20 log files together are more than xx MB in size.
The remaining 10 files (xx.log_old) should be ignored when calculating the size.
Folder/FileSize with UNC \\xx\yy\*.log does not work.
Kind regards
Uwe
Is it possible to check the cumulative size of all the *.log files in a folder?
There are 30 files in the folder - 20 of them are ".log" files.
I would like to be notified if all 20 log files together are more than xx MB in size.
The remaining 10 files (xx.log_old) should be ignored when calculating the size.
Folder/FileSize with UNC \\xx\yy\*.log does not work.
Kind regards
Uwe
Re: Check cumulative size of all the *.log files in a folder
What exactly means "does not work"? Unknown test status and some error in Reply field? "Access is denied"? Wrong size displayed? Something else?
Windows version on local and remote system? Both systems located in the same domain? Different domains? Non-domain systems?
HostMonitor started as service or application?
Have you set user account for this remote connection using Connection Manager?
If you need to check files on remote system, I would suggest to use RMA (Remote Monitoring Agent).
https://www.ks-soft.net/hostmon.eng/rma-win/index.htm
UNC paths work slowly even if local UNC is used (e.g. \\?\C:\Logs\*.LOG). Its Ok for single file but not recommended when you need to check many files.
Also RMA helps to avoid all kind of problems related to Windows rights and permissions and you don't need to share resources.
Regards
Alex
Windows version on local and remote system? Both systems located in the same domain? Different domains? Non-domain systems?
HostMonitor started as service or application?
Have you set user account for this remote connection using Connection Manager?
If you need to check files on remote system, I would suggest to use RMA (Remote Monitoring Agent).
https://www.ks-soft.net/hostmon.eng/rma-win/index.htm
UNC paths work slowly even if local UNC is used (e.g. \\?\C:\Logs\*.LOG). Its Ok for single file but not recommended when you need to check many files.
Also RMA helps to avoid all kind of problems related to Windows rights and permissions and you don't need to share resources.
Regards
Alex
Re: Check cumulative size of all the *.log files in a folder
Hi Alex,
Thanks for the quick reply.
Not "working means" that all files in the folder are added to the size and not just the .log
As an example:
I have 10 xxx.log with 1 MB size each and 10 xxx.log_old with 2 MB size each, the result is 30 MB and not 10 MB (as desired).
Best regards
Uwe
Thanks for the quick reply.
Not "working means" that all files in the folder are added to the size and not just the .log
As an example:
I have 10 xxx.log with 1 MB size each and 10 xxx.log_old with 2 MB size each, the result is 30 MB and not 10 MB (as desired).
Best regards
Uwe
Re: Check cumulative size of all the *.log files in a folder
We cannot reproduce the problem.
HostMonitor version?
Windows version?
May be you are using *.log* mask?
Regards
Alex
HostMonitor version?
Windows version?
May be you are using *.log* mask?
Regards
Alex
Re: Check cumulative size of all the *.log files in a folder
Hi Alex,
HM Version 14.90
Test is: "Folder/File Size"
Folder/File Path is: \\<OurServer\<OutShare>\Serverwartung_Log\*.log
Directory Listing from \\<OurServer\<OutShare>\Serverwartung_Log\
11.01.2022 14:32 3.353.464 Bginfo.log_OLD
11.01.2022 14:32 3.353.464 BginfoCAS.log_OLD
11.01.2022 14:32 3.353.464 Bginfofs1.log_OLD
02.12.2024 06:15 3.115.354 delage_cas.log
02.12.2024 06:41 3.146.631 delage_fs1.log
02.12.2024 05:45 781.973 delage_rds.log
02.12.2024 12:15 16,705 delage_sql2016.log
22.07.2024 08:14 1,347,996 delage_sqldbsrv.log
26.09.2024 07:57 390,256 delage_userfs.log
02.12.2024 06:45 1.323.113 delage_veeam.log
10 Datei(en), 20,182,420 Bytes
Response from HM is 19 MB (=20,182,420 Bytes)
Desired Response from HM would be 10 MB (=10,122,028 Bytes) for the following files (the .log_old should be ignored):
02.12.2024 06:15 3.115.354 delage_cas.log
02.12.2024 06:41 3.146.631 delage_fs1.log
02.12.2024 05:45 781.973 delage_rds.log
02.12.2024 12:15 16,705 delage_sql2016.log
22.07.2024 08:14 1,347,996 delage_sqldbsrv.log
26.09.2024 07:57 390,256 delage_userfs.log
02.12.2024 06:45 1.323.113 delage_veeam.log
7 Datei(en), 10,122,028 Bytes
Thanks in advanced
Uwe
HM Version 14.90
Test is: "Folder/File Size"
Folder/File Path is: \\<OurServer\<OutShare>\Serverwartung_Log\*.log
Directory Listing from \\<OurServer\<OutShare>\Serverwartung_Log\
11.01.2022 14:32 3.353.464 Bginfo.log_OLD
11.01.2022 14:32 3.353.464 BginfoCAS.log_OLD
11.01.2022 14:32 3.353.464 Bginfofs1.log_OLD
02.12.2024 06:15 3.115.354 delage_cas.log
02.12.2024 06:41 3.146.631 delage_fs1.log
02.12.2024 05:45 781.973 delage_rds.log
02.12.2024 12:15 16,705 delage_sql2016.log
22.07.2024 08:14 1,347,996 delage_sqldbsrv.log
26.09.2024 07:57 390,256 delage_userfs.log
02.12.2024 06:45 1.323.113 delage_veeam.log
10 Datei(en), 20,182,420 Bytes
Response from HM is 19 MB (=20,182,420 Bytes)
Desired Response from HM would be 10 MB (=10,122,028 Bytes) for the following files (the .log_old should be ignored):
02.12.2024 06:15 3.115.354 delage_cas.log
02.12.2024 06:41 3.146.631 delage_fs1.log
02.12.2024 05:45 781.973 delage_rds.log
02.12.2024 12:15 16,705 delage_sql2016.log
22.07.2024 08:14 1,347,996 delage_sqldbsrv.log
26.09.2024 07:57 390,256 delage_userfs.log
02.12.2024 06:45 1.323.113 delage_veeam.log
7 Datei(en), 10,122,028 Bytes
Thanks in advanced
Uwe
Re: Check cumulative size of all the *.log files in a folder
Addendum:
Found the error myself:
.log_old is still recognised as *.log.
If I rename the OLD files from .log_old to .log.old, HM delivers the desired result.
Thank you Alex
Found the error myself:
.log_old is still recognised as *.log.
If I rename the OLD files from .log_old to .log.old, HM delivers the desired result.
Thank you Alex
Re: Check cumulative size of all the *.log files in a folder
Oh, yes, I forgot how Windows works.
For each file with long name it also creates short name, so file "1010.log_old" also listed as "1010~1.log" and this alias fits *.log mask.
Count Files test method uses additional checks that eliminate this problem.
Probably we should do the same for Folder/File Size test
Regards
Alex
For each file with long name it also creates short name, so file "1010.log_old" also listed as "1010~1.log" and this alias fits *.log mask.
Count Files test method uses additional checks that eliminate this problem.
Probably we should do the same for Folder/File Size test
![:roll:](./images/smilies/icon_rolleyes.gif)
Regards
Alex
Re: Check cumulative size of all the *.log files in a folder
Long file names are no longer really a novelty or rarity.
And at first, of course, the result is extremely confusing.
Personally, I would of course very much welcome it if HM were to process this correctly at some point
Kind regards
Uwe
And at first, of course, the result is extremely confusing.
Personally, I would of course very much welcome it if HM were to process this correctly at some point
Kind regards
Uwe
Re: Check cumulative size of all the *.log files in a folder
BTW: There is Windows registry setting and Windows tool that may fix the problem and also should increase speed of the file system BUT may lead to problems if you are using some very old software that do not work correctly with long file names
https://learn.microsoft.com/en-us/previ ... dfrom=MSDN
Regards
Alex
https://learn.microsoft.com/en-us/previ ... dfrom=MSDN
Regards
Alex
Re: Check cumulative size of all the *.log files in a folder
Thanks for the tip.
I had read this a long time ago - but didn't (yet) dare to use it - sometimes you're amazed at the legacy issues that even ‘modern’ software carries around with it![:-)](./images/smilies/icon_smile.gif)
I had read this a long time ago - but didn't (yet) dare to use it - sometimes you're amazed at the legacy issues that even ‘modern’ software carries around with it
![:-)](./images/smilies/icon_smile.gif)
Re: Check cumulative size of all the *.log files in a folder
If it works, don't touch it
We just tested another Windows API that suppose to work properly but it works the same way - returns files like file11.log_old when mask *.log is used. And as I see console command "dir *.log" works the same way, at least on Windows XP, Windows 7, Windows 11.
While mask *.lo works as expected, finds files with "lo" extension only.
So, its not a bug and not a problem related to short names. That's how things suppose to work on Windows, everything after 3rd letter of extension fits any mask?
But if mask contains more characters, then it start to work in 'correct' way. E.g.
filezi*.log returns filezila1.log and filezila1.log_old
while
filezil*.log returns filezila1.log only, filezila1.log_old skipped
So, on the one hand, this behavior does not look logical, on the other hand, that's how Windows has been working for over 20 years and HostMonitor should follow Windows rules and behavior..
I assume this behavior must be described in some Microsoft manual.
Regards
Alex
![:)](./images/smilies/icon_smile.gif)
We just tested another Windows API that suppose to work properly but it works the same way - returns files like file11.log_old when mask *.log is used. And as I see console command "dir *.log" works the same way, at least on Windows XP, Windows 7, Windows 11.
While mask *.lo works as expected, finds files with "lo" extension only.
So, its not a bug and not a problem related to short names. That's how things suppose to work on Windows, everything after 3rd letter of extension fits any mask?
But if mask contains more characters, then it start to work in 'correct' way. E.g.
filezi*.log returns filezila1.log and filezila1.log_old
while
filezil*.log returns filezila1.log only, filezila1.log_old skipped
So, on the one hand, this behavior does not look logical, on the other hand, that's how Windows has been working for over 20 years and HostMonitor should follow Windows rules and behavior..
I assume this behavior must be described in some Microsoft manual.
Regards
Alex
Re: Check cumulative size of all the *.log files in a folder
We added new option, you may contact support by e-mail and get update
Regards
Alex
Regards
Alex