Changeset 8321 in genesis for nodes/status-monitoring.py


Ignore:
Timestamp:
Aug 12, 2010, 3:33:42 PM (14 years ago)
Author:
rick
Message:

Grumble keys got confused everywhere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nodes/status-monitoring.py

    r8319 r8321  
    257257
    258258  # 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
    260265     config = configs[host]
    261266     print "# Problems in host '%s'" % host
    262267     host_down = True
    263268     for ip in gformat.get_used_ips([config]):
     269       if not gformat.valid_addr(ip):
     270         continue
    264271       if status[ip]['state'] == "up":
    265272         host_down = False
     
    267274     if host_down:
    268275       print "## HOST is DOWN!"
    269        nodemap['node'][host] = gformat.DOWN
     276       nodemap['node'][fqdn] = gformat.DOWN
    270277     else:
    271278       print "## SNMP problems (not reachable, deamon not running, etc)"
    272        nodemap['node'][host] = gformat.UNKNOWN
     279       nodemap['node'][fqdn] = gformat.UNKNOWN
    273280
    274281       
    275282
    276283  # Correlation mapping
    277   for host, details in host_processed.iteritems():
    278     nodemap['node'][host] = gformat.OK
    279     print "# Working on %s" % host
     284  for fqdn, details in host_processed.iteritems():
     285    nodemap['node'][fqdn] = gformat.OK
     286    print "# Working on %s" % fqdn
    280287    for ip, arpmac in details['arpmac'].iteritems():
    281288      if arpmac in details['mac'].keys():
     
    285292        print "## [WARN] No parent host for MAC %s (%s) found" % (arpmac, ip)
    286293      else:
    287         print "## Interlink %s - %s"  % (host, mac_to_host[arpmac])
    288         nodemap['link'][(host,mac_to_host[arpmac])] = gformat.OK
     294        print "## Interlink %s - %s"  % (fqdn, mac_to_host[arpmac])
     295        nodemap['link'][(fqdn,mac_to_host[arpmac])] = gformat.OK
    289296
    290297  stream = file(nodemap_status_file,'w')
Note: See TracChangeset for help on using the changeset viewer.