Test log file - last created of last modified file

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
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Test log file - last created of last modified file

Post by oryagel »

Hi,

I need to check a log file for specific words.
The problem is that every few hours a new log file is created.

I want to always check the last modified/last created file in a specific folder.

How can I do that?

Thanks
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Then use Text Log test and specify %NewestFile% variable instead of filename
http://www.ks-soft.net/hostmon.eng/mfra ... htm#macros

PS: may be you may use Compare Files test instead of Text Log, depending on how exactly you need to check the log

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Thanks

1. I want to check for good expression instead of bad.

The test should be somthing like:
Every 15 minutes there must be a new "good record"

Can I do this using a reverse alert?

2. I used the "NewestFile" variable but I'm getting "RMA: Test Error"
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

1. I want to check for good expression instead of bad.
Can I do this using a reverse alert?
Sure, why not?[/quote]
I used the "NewestFile" variable but I'm getting "RMA: Test Error"
It should be %NewestFile%
What version of HostMonitor/RMA do you use?

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

This is how I used the variable:
C:\ProgramData\XYZ\Logs\%NewestFile%

HostMonitor: 8.64
RMA: 4.08

Edit1:
I upgraded to:
HostMonitor: 8.72
RMA: 4.10

Same issue

Edit2:
I checked the "use date macros" checkbox and now it works.

I still have problems with the test.
Reverse alert will give me good status for "Bad Text".
But I need it also to give Bad status when the Text isn't found.
How can I get it done?


Thanks
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I checked the "use date macros" checkbox and now it works
Yes, you need this option for sure. Otherwise HostMonitor does not process variables
I still have problems with the test.
Reverse alert will give me good status for "Bad Text".
But I need it also to give Bad status when the Text isn't found
That's how it works. What is the problem?
What test method do you use? Text Log or Compare Files?

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

I'm using Text Log with reverse alert.

When there is no new "Bad Record" the status stays OK.
I need it to be bad.
I need to check that there is a new record X in the file every few minuts.

Can't get it done.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

May we see your test settings?
You may export test settings into text file using menu File -> Export to text file.

Regards
Alex
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Of course test does not change its status to Ok (Bad after Reverse function applied) because you set "set Ok status by acknowledgement (manually)" option for the test.
You should use default "set Ok status when no new Bad records detected" option, located on Text Log properties dialog.

Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... tm#textlog

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Thanks

The "NewestFile" variable give the last modified file.
How can I get the last created file?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, there is no such option

Regards
Alex
Post Reply