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,
How to Monitor inside log files
What should be done whenIf 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.
- both records in the file?
- no records in the file?
"newest log file" - file created after last test probe?We have a share with several log files. We want to look inside the "newest" log file every day at a specific time.
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
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?
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?
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
- 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
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,
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,
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: