Archived community.zenoss.org | full text search
Skip navigation
1115 Views 1 Reply Latest reply: Aug 17, 2012 7:17 AM by dg1101 RSS
dg1101 Newbie 3 posts since
Aug 16, 2012
Currently Being Moderated

Aug 17, 2012 7:18 AM

Copy/Override Template using zendmd

Hello, relative newbie to the world of zenoss here!

 

I'm looking for a way of copying a template from one deviceClass to another using zendmd (to perform the same operation as the menu item "Override Template") Hoping to use zendmd so our installation/configuration of zenoss can be completely scripted.

 

I've seen examples of how to apply templates at a device level, but I can't seem to get them to work for a device class.

 

So, current situation is we have a template from a comunity ZenPack that applies to Devices\Servers. I want to make this apply to Devices\Server\MyClass - a straightforward operation from within the GUI. (Essentially, I want the template to apply to all devices (existing and new) in \Server\MyClass by default, but not to ones in \Server)

 

So butchering a similar example (from docs/DOC-2526), what I've attempted is this:-

 

template = dmd.Devices.Server.rrdTemplates.MyTemplate

dest = dmd.Devices.Server.MyClass

dest._setObject(template.id,template._getCopy(dest))

commit()

 

This seems to create a copy of the template, but applying to "Devices\MyClass" instead of "Devices\Server\MyClass"

 

Can anyone suggest a better method, or point me in the right direction. Apologies if I've performed some horrendous zendmd abuse!



More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points