Advertisement
cyid

Set cFSThreshold

Nov 3rd, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. group = 'Customer/A-I/H/HWT'
  2. threshold = 101
  3. code = 'RED'
  4. label = 'sapdata'
  5. devices = dmd.Groups.unrestrictedTraverse(group).getSubDevices()
  6. for d in devices:
  7.     ths = []
  8.     for fs in d.os.filesystems():
  9.         if label.lower() in (fs.title).lower():
  10.             th = "fs!{0}:ZenThresh:{1}:code:{2}".format(fs.mount, threshold, code)
  11.             #ths = d.cFSThreshold
  12.             try:
  13.                 if ths.index(th): continue
  14.             except ValueError:
  15.                 ths.append(th)
  16.                 d.setZenProperty('cFSThreshold', ths)
  17.                 print d.id
  18.                 print ths
  19.                 commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement