View previous topic :: View next topic |
Author |
Message |
sebirello
Joined: 02 Nov 2016 Posts: 25
|
Posted: Wed Jan 17, 2018 2:05 am Post subject: TestLog Test not working |
|
|
Hello,
I have created a TestLog - test, but for some reason it is not working correctly.
Regardless what I configure it always says, that the test is "OK", but it isn't.
I've created a .log - File on a server and putted the string "java.lang.NullPointerException" in it, then I configured the test as following:
'Bad' text = java.lang.NullPointerException
--> Look for "string" java.lang.NullPointerException
--> set "Ok" status when now new "bad" records detected
'Good' text = [Unused. Set Ok after next probe]
Warn of = last new event
Display = found line
HostMonitor version: 9.90
OS: Windows Server 2012 R2
Thanks for your help!
Kind Regards,
Sebastian |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Wed Jan 17, 2018 2:36 am Post subject: |
|
|
Quote: | File on a server and putted the string "java.lang.NullPointerException" in it, then I configured the test as following:
|
It works as designed. "As designed" means test checks for NEW records.
Quote from the manual Quote: | Unlike "Compare Files" test that warns you when any part of a file contains some specific string the Text Log test warns you only when 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. So the Text Log test works like NT Event Log test but it checks text files instead of NT Event Log Database. |
You added record into the file then created test so test ignores old record.
If you does not care when record was added into file, then use Comprare Files test.
Regards
Alex |
|
Back to top |
|
|
sebirello
Joined: 02 Nov 2016 Posts: 25
|
Posted: Wed Jan 17, 2018 6:57 am Post subject: |
|
|
I see, thanks for the explanation.
What I have noticed it too only recognizes the entries in new lines, so for example if I create a string in line 1 and then delete it and recreate it in line one, the test will be ok.
Another question, is it possible to add multiple strings for each test per file, or do I have to create several tests each file?
Thank you!
Kind Regards,
Sebastian |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Wed Jan 17, 2018 7:34 am Post subject: |
|
|
Quote: | What I have noticed it too only recognizes the entries in new lines, so for example if I create a string in line 1 and then delete it and recreate it in line one, the test will be ok. |
Correct.
This test designed to check log files. Normally records added into the log file one after another.
Quote: | Another question, is it possible to add multiple strings for each test per file, or do I have to create several tests each file? |
No sure I understand what exactly means "add multiple strings".
If you want to set Bad test status when "error" or "warning" logged, then use "Look for expression" mode with ('error' or 'warning') expression
Regards
Alex |
|
Back to top |
|
|
sebirello
Joined: 02 Nov 2016 Posts: 25
|
Posted: Wed Jan 17, 2018 8:01 am Post subject: |
|
|
No sure I understand what exactly means "add multiple strings".
If you want to set Bad test status when "error" or "warning" logged, then use "Look for expression" mode with ('error' or 'warning') expression
Quote: | For example one string is "error" and the other one in another line is "bad", I guess I have to use an expression for that? |
Regards
Sebastian |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Wed Jan 17, 2018 9:00 am Post subject: |
|
|
You tell me about strings but you did not say anything about your needs.
>For example one string is "error" and the other one in another line is "bad"
Ok, one string is "error", another is "bad". What's next? How do you want to process these strings?
E.g.
1) Set "Bad" test status when any of these strings appear in some line of text file?
2) Set "Bad" status when "error" appears in some line and "Bad" appears in the next line?
3) Something else?
Regards
Alex |
|
Back to top |
|
|
sebirello
Joined: 02 Nov 2016 Posts: 25
|
Posted: Thu Jan 18, 2018 8:10 am Post subject: |
|
|
Hi Alex,
1) Set "Bad" test status when any of these strings appear in some line of text
Kind Regards,
Sebastian |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Thu Jan 18, 2018 8:57 am Post subject: |
|
|
Then my 1st answer was correct Quote: | if you want to set Bad test status when "error" or "warning" logged, then use "Look for expression" mode with ('error' or 'warning') expression | or in your case ('error' or 'bad')
Regards
Alex |
|
Back to top |
|
|
sebirello
Joined: 02 Nov 2016 Posts: 25
|
Posted: Thu Jan 18, 2018 9:28 am Post subject: |
|
|
Alright, thank you very much!
Kind Regards,
Sebastian |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12807 Location: USA
|
Posted: Thu Jan 18, 2018 9:34 am Post subject: |
|
|
You are welcome
Regards
Alex |
|
Back to top |
|
|
|