Changeset 8321 in genesis for nodes/status-monitoring.py
- Timestamp:
- Aug 12, 2010, 3:33:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/status-monitoring.py
r8319 r8321 257 257 258 258 # List of hosts which has some kind of problem 259 for host in list(set(configs.keys()) - set(host_processed.keys())): 259 print host_processed.keys() 260 print configs.keys() 261 for host in configs.keys(): 262 fqdn = host + ".wLeiden.NET" 263 if fqdn in host_processed.keys(): 264 continue 260 265 config = configs[host] 261 266 print "# Problems in host '%s'" % host 262 267 host_down = True 263 268 for ip in gformat.get_used_ips([config]): 269 if not gformat.valid_addr(ip): 270 continue 264 271 if status[ip]['state'] == "up": 265 272 host_down = False … … 267 274 if host_down: 268 275 print "## HOST is DOWN!" 269 nodemap['node'][ host] = gformat.DOWN276 nodemap['node'][fqdn] = gformat.DOWN 270 277 else: 271 278 print "## SNMP problems (not reachable, deamon not running, etc)" 272 nodemap['node'][ host] = gformat.UNKNOWN279 nodemap['node'][fqdn] = gformat.UNKNOWN 273 280 274 281 275 282 276 283 # Correlation mapping 277 for host, details in host_processed.iteritems():278 nodemap['node'][ host] = gformat.OK279 print "# Working on %s" % host284 for fqdn, details in host_processed.iteritems(): 285 nodemap['node'][fqdn] = gformat.OK 286 print "# Working on %s" % fqdn 280 287 for ip, arpmac in details['arpmac'].iteritems(): 281 288 if arpmac in details['mac'].keys(): … … 285 292 print "## [WARN] No parent host for MAC %s (%s) found" % (arpmac, ip) 286 293 else: 287 print "## Interlink %s - %s" % ( host, mac_to_host[arpmac])288 nodemap['link'][( host,mac_to_host[arpmac])] = gformat.OK294 print "## Interlink %s - %s" % (fqdn, mac_to_host[arpmac]) 295 nodemap['link'][(fqdn,mac_to_host[arpmac])] = gformat.OK 289 296 290 297 stream = file(nodemap_status_file,'w')
Note:
See TracChangeset
for help on using the changeset viewer.