Changeset 8332 in genesis
- Timestamp:
- Aug 12, 2010, 9:50:46 PM (14 years ago)
- Location:
- nodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/get-network-status.py
r8328 r8332 131 131 132 132 133 def do_snmp_scan(iphosts, status, stored_status=dict() ):133 def do_snmp_scan(iphosts, status, stored_status=dict(), forced_scan=False): 134 134 """ SNMP scanning, based on results fould in NMAP scan""" 135 135 mac_to_host = dict() … … 156 156 status[host]['iface'] = dict() 157 157 try: 158 if stored_status[host]['snmp_retval'] != 0:158 if not forced_scan and stored_status[host]['snmp_retval'] != 0: 159 159 print "## SNMP Connect failed last time, ignoring" 160 160 continue … … 231 231 print "## Arp table MAC %s -> %s %s" % (ip, mac, local) 232 232 233 # Make sure we keep a record of the processed host 234 host_processed[hostname] = status[host]233 # Make sure we keep a record of the processed host which ip entry to check 234 host_processed[hostname] = host 235 235 236 236 stored_status['host_processed'] = host_processed … … 282 282 283 283 # Correlation mapping 284 for fqdn, details in host_processed.iteritems(): 284 for fqdn, ip in host_processed.iteritems(): 285 details = status[ip] 285 286 nodemap['node'][fqdn] = gformat.OK 286 287 print "# Working on %s" % fqdn … … 386 387 # Do SNMP discovery 387 388 if opt_snmp_scan: 388 snmp_status = do_snmp_scan(iplist, nmap_status, stored_status )389 snmp_status = do_snmp_scan(iplist, nmap_status, stored_status, opt_force_snmp) 389 390 else: 390 391 snmp_status = stored_status -
nodes/gformat.py
r8323 r8332 312 312 addr, mask = l.split('/') 313 313 # Special case do not process 314 if not valid_addr(addr): 315 ip_list.append(addr) 314 if valid_addr(addr): 315 ip_list.append(addr) 316 else: 317 print "## IP '%s' in '%s' not valid" % (addr, config['nodename']) 316 318 return sorted(ip_list) 317 319
Note:
See TracChangeset
for help on using the changeset viewer.