GijsbertVanOeveren wrote:The result is that I only get a warning when the errormessage is found in all logfiles instead of after a single occurrence.
In fact, "Text Log" test method does not process all the files. If you specify the wildcards in the name of the file, the 1st matched file will be checked.
Also, "Text Log" test method works in a way, when it warns you only if the string is found in a NEW record. It means that if log file already has "bad' records when you started HostMonitor, you will not receive any alerts; but if any new "bad" record will be added to the log file while HostMonitor is running, you will receive a warning about the new problem.
If you just want to check specific string in any part of the file, you may use "Compare Files" test method, which provides "alert when file contains a specified string" option:
http://www.ks-soft.net/hostmon.eng/mfra ... tm#filecmp
GijsbertVanOeveren wrote:Is there a possibility to monitor all files and fire a warning if the criterium is experienced in just 1 of the files?
Lets clarify it a bit, because I do not completely understand your needs. Do you mean, you want to check all files and fire alert when the criterium is experienced in only one file (if two of more files match the criteria we do not fire alert) or when the criterium is experienced in at least one file?
Both solutions might be implemented using "Shell script" test method. You just should create a simple .bat file, that use "for" command to enumerate all necessaryfiles in a folder, and "type filename | find "String errormessage"" commands to check if the file contains the string.
I can assist you developing such a script, if you like. Or you may try to create it by yourself.
http://www.ks-soft.net/hostmon.eng/tests.htm#chkShell
Please note: The following rules must be obeyed when creating a script:
===============================
The script or external program must write to stdout (standard output stream) single result string. This string should contain 3 parts separated by colon (:).
1. First obligatory part - marker "scriptres" tells to HostMonitor or RMA that this string is the result string.
2. Second obligatory part represents the test status, it can take one of the following values (case insensitive):
Status string Comment
Host is alive status means " script executed successfully, target system correctly responds"
No answer script executed successfully, target system does not respond
Unknown status means "test cannot be performed for some reason"
Unknown host use this status when script cannot resolve target host name into IP address
Ok script executed, result satisfies (some) requirements
Bad script executed, result does not satisfy (some) requirements
Bad contents use this status if script found some error in monitored file, web page, etc
3. Third optional part contains Reply value, HostMonitor displays this value in Reply field, writes to log files, uses to displays charts (Log Analyzer), etc. If you want Log Analyzer to process Reply values correctly and display charts, use one of the following formats for Reply value:
* decimal_number (like "123", "0", "6456.45". as decimal separator use symbol that is specified on your system, usually a dot (.) or a comma (,))
* decimal_number + space + "Kb" (like "512 Kb", "64 Kb")
* decimal_number + space + "Mb" (like "1024 Mb", "5 Mb")
* decimal_number + space + "Gb" (like "12 Gb", "4 Gb")
* decimal_number + space + "%" (like "50 %", "99 %")
* decimal_number + space + "ms" (like "100 ms", "5400 ms")
Several examples:
String printed by script "Status" of the test "Reply" field of the test
scriptres:Host is alive:1000 ms Host is alive 1000 ms
scriptres:Unknown host: Unknown host
scriptres:Ok:300 Kb Ok 300 Kb
scriptres:Bad:90 % Bad 90 %
That's it. Everything else is entirely up to you
===============================
Regards,
Max