source: people/peter.buschman/backup_monitoring/parsing/parsers/bpdbjobs/test.py@ 1084

Last change on this file since 1084 was 976, checked in by peter, on Dec 6, 2011 at 10:19:33 AM

Raw checkin of current NetBackup / TSM parsing code.

File size: 706 bytes
Line 
1
2import time
3
4from backup_monitoring.parsing.parsers import bpdbjobs as parser
5
6file = open('test.txt', 'r')
7
8stream = parser.stream(file)
9
10i = 0
11
12for record in stream:
13
14 i += 1
15
16 job = parser.parse(record)
17
18 jobid = job.jobid
19 jobtype = job.jobtype
20 state = job.state
21 stunit = job.stunit
22
23 #print 'jobid=%d, jobtype=%s, state=%s, stunit=%s' % (jobid, jobtype, state, stunit)
24
25 if jobtype == 'backup' and state == 'active':
26
27 #print 'jobid=%d, jobtype=%s, state=%s, stunit=%s' % (jobid, jobtype, state, stunit)
28
29 for key, value in job.items():
30 print '[%s] = [%s]' % (key, value)
31
32 time.sleep(5)
33
34file.close()
Note: See TracBrowser for help on using the repository browser.