Hello,
I have 1 log folder.
In this Folder I want that the Hostmonitor looks in every log file. But the log files have different Filenames like xx_xx_xx_001.log or yy_003.log
Can the Hostmonitor check all log files in this Folder and search for a sting (error, failed…)?
And if he find a string can he send me an E-Mail with the log file as attachment?
Hostmonitor version 6.54
Thanks
Regards
Genesis
search in a folder
Then you need to create script that will check files one by one and use Shell Script test method to run the script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Something like
====================
@echo off
for %%i in (c:\targetfolder\*.log) do (
find /c "searchstring" %%i
if not errorlevel 1 (
echo scriptres:Bad:%%i
exit
)
)
====================
Script returns name of the file that contains specified string (1st of such files) so you may use %Reply% variable as parameter of the action to show name of the file.
Regards
Alex
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Something like
====================
@echo off
for %%i in (c:\targetfolder\*.log) do (
find /c "searchstring" %%i
if not errorlevel 1 (
echo scriptres:Bad:%%i
exit
)
)
====================
Script returns name of the file that contains specified string (1st of such files) so you may use %Reply% variable as parameter of the action to show name of the file.
Regards
Alex