Text log folder path macro

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
rbaca
Posts: 15
Joined: Thu Dec 15, 2005 4:37 pm

Text log folder path macro

Post by rbaca »

Hi Max:
I have a text log issue that I would like to solve using Host Monitor. We have a tool that collects snmp and stores certain information about the devices in a text file. The text log filename is always the same, but the folder path changes every day. The folder path is based on current date, so that today the full path may be c:\logfiles\2008\04\08\logfile.txt, but tomorrow it will be c:\logfiles\2008\04\09\logfile.txt, and so on. I want to do a log file test to verify that it exists and then to look for a specific string in the logfile at the beginning of the file. This only needs to be done once per day and I want to be alerted if either the file is missing or the specific string is missing. Can this be done?

Thanks!
Randy
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I think, you just should setup single "Compare Files" test method with "alert when file does not contain a specified string" option enabled. http://www.ks-soft.net/hostmon.eng/mfra ... tm#filecmp
To make it work properly, you have to enable "Translate macros" option and specify filepath using date macros, e.g.: c:\logfiles\%yyyy%\%mm%\%dd%\logfile.txt
Also, you should enable "Treat Unknown status as Bad" option for this test. With this configuration, test status becomes "Bad", when specified string is not found in the file, and becomes "Unknown" with "File c:\logfiles\2008\04\09\logfile.txt not found" message in "Reply" field when there is no such a file in a folder.
Does it suit your needs?

On the other hand, you may setup two separate tests. The first one should be "Compare Files" test described above, and the second should be "Folder/File Availability" test method: http://www.ks-soft.net/hostmon.eng/mfra ... #fileexsts
You may specify "Folder/File Availability" as a "Master" for "Compare Files" test: http://www.ks-soft.net/hostmon.eng/mfra ... htm#Master

Regards,
Max
Post Reply