Changeset 10040 in genesis
- Timestamp:
- Mar 6, 2012, 1:51:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/get-link-traffic.py
r10035 r10040 6 6 # Rick van der Zwet <info@rickvanderzwet.nl> 7 7 # 8 import gformat 8 9 import glob 9 10 import logging … … 65 66 ff = '' 66 67 67 def process_file(logger, m_snmp, m_traffic, m_uptime, nf, rescan):68 data = yaml.load(open(nf,'r'))68 def process_file(logger, m_snmp, m_traffic, m_uptime, host, rescan): 69 data = gformat.get_yaml(host) 69 70 nodename = data['nodename'] 70 71 … … 113 114 logger = logging.getLogger('Worker%s' % i) 114 115 logger.info("Worker") 115 for ( nf, rescan) in iter(input.get, 'STOP'):116 process_file(logger, m_snmp, m_traffic, m_uptime, nf, rescan)116 for (host, rescan) in iter(input.get, 'STOP'): 117 process_file(logger, m_snmp, m_traffic, m_uptime, host, rescan) 117 118 logger.info("END") 118 119 … … 140 141 plist[i].start() 141 142 142 for nf in sorted(glob.glob('nodes/*%s*/wleiden.yaml' % ff)): 143 task_queue.put((nf, RESCAN)) 143 for host in sorted(gformat.get_hostlist()): 144 if ff and not ff in host: 145 continue 146 task_queue.put((host, RESCAN)) 144 147 145 148 for i in range(NUMBER_OF_PROCESSES):
Note:
See TracChangeset
for help on using the changeset viewer.