ZenDMD Tip - Check and Repair Device Objects with Missing DeviceClass

From Zenoss Wiki
Revision as of 16:34, 20 July 2012 by 50.56.228.65 (Talk)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

su zenoss, zendmd

  def checkDeviceClass(d):
      print "Checking Device Class linkage for %s" % d.titleOrId()
      if d.deviceClass == None:
          dc = d.getPrimaryParent().getPrimaryParent()
          d.deviceClass._add(dc)
  d=dmd.Devices.findDevice('yourDevice')
  checkDeviceClass(d)

Best, --Shane (Hackman238)