I’m trying to figure out if there is a way to to report on successful backup of Oracle based on a log file. What I’m looking to do is for BigFix to automatically report when backup has not been successful the past two days. The report will be based upon one log file from Oracle and one from TSM. Can someone describe how I should move forward?
If the answer to both of those questions is yes, then you could use an analysis to scan these files for your “has not successfully backed up in 2 days” condition.
Here is a simple example of scanning a log for a success in the last 2 days:
c:\ora.log
31 JUL 2007 - 14:45:44
Backup was successful
01 AUG 2007 - 14:55:13
Backup failed
02 AUG 2007 - 15:02:53
Backup was successful
relevance for analysis or retrieved property:
exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) >= 2*day) of file “c:\ora.log” ))
I used an easy to handle date format in my log but any format can be handled with careful string processing.
I would need more details to get any more specific.
Hi Brolly changed the log file a bit and it returns true no matter how long ago it was ago the log file returns true.
log file
01 JUL 2006 - 14:45:44
backup was successful
01 AUG 2007 - 14:55:13
Backup failed
10 AUG 2007 - 15:02:53
backup was successful
Relevance
Q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) >= 2*day) of file “C:\download\bigfix\training\backuplog.txt” ))
Are you sure you went back far enough? The successful date in the log file is in 2006:
01 JUL 2006 - 14:45:44
backup was successful
01 AUG 2006 - 14:55:13
Backup failed
02 AUG 2006 - 15:02:53
Backup failed
This works for me:
// Has there been a successful backup in the last 4 days?
q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) <= 4*day) of file “C:\backuplog.txt” ))
A: False
// Has there been a successful backup in the last 500 days?
q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) <= 500*day) of file “C:\backuplog.txt” ))
A: True