How to Monitor inside log files

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
Bartb
Posts: 4
Joined: Wed Feb 19, 2014 4:39 am

How to Monitor inside log files

Post by Bartb »

Hello,

We have a share with several log files. We want to look inside the "newest" log file every day at a specific time.
If the text file (log file) contains "Records failed: 0" then the test is OK
If the text file contains "Records failed: <greater then 0>" the test must become red and send a mail everytime it becomes red.
witch test method to I have to use and can you provide an example of it?

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

Post by KS-Soft »

If the text file (log file) contains "Records failed: 0" then the test is OK
If the text file contains "Records failed: <greater then 0>" the test must become red and send a mail everytime it becomes red.
What should be done when
- both records in the file?
- no records in the file?
We have a share with several log files. We want to look inside the "newest" log file every day at a specific time.
"newest log file" - file created after last test probe?
so you don't know file name and you need to find this newest file and check entire contents?

or "newest log file" means there are several specific files (you know name of these files)
and you want to check NEW records only (records added since previous test probe)?

Regards
Alex
Bartb
Posts: 4
Joined: Wed Feb 19, 2014 4:39 am

Post by Bartb »

Hello,

THX for the reply. This is an example of the log file (always the same structure)
D:\import\Personeel-BadgeID.CSV
Operation mode: Import
Time started: Wed Feb 19 07:58:54 CET 2014
Time finished: Wed Feb 19 08:02:26 CET 2014

Records successfully processed: 4942
Records failed: 0

Records added: 2
Records updated: 4940
Records deleted: 0

So both records in the file is not possible. (I hope ;-))

filenames are like this :

20140219080226_Personeel-BadgeID.CSV
20145818075827_Personeel-BadgeID.CSV
20145417075419_Personeel-BadgeID.CSV

Normally there is only one file a day. I want to keep the test simple so taking %NewestFile% seems the most simple solution?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Then use Compare Files test method
- Alert when "file does not contain string"
- File: D:\import\%NewestFile%
- String: Records failed: 0

If you want to start alert in case file was not created, use 2nd test
Folder/File Availability
- File: D:\import\%NewestFile%
- Alert when file doesn't exist or older then 1440 min

Regards
Alex
Bartb
Posts: 4
Joined: Wed Feb 19, 2014 4:39 am

Post by Bartb »

Hello,

I created both tests.

In test 1 (Compare files) the test doesn't work with %NewestFile% (Reply : File "%NewestFile" not found). When we select one of the log files the test is working fine.

In test 2 (Folder/File Availability) the test is working fine with %NewestFile%

We are using v. 9.58 of Hostmonitor

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

Post by KS-Soft Europe »

Please mark "Translate macros" option for both test items.
Bartb
Posts: 4
Joined: Wed Feb 19, 2014 4:39 am

Post by Bartb »

Hello Alex,

Enabling "Translate Marcos" did the trick! Thanks a lot for all the reply's. Both test are working fine now.

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

Post by KS-Soft »

You are welcome

Regards
Alex
Post Reply