Discussion:
Toggle template binding for a Device Class from zendmd?
mahimahi
2011-10-17 22:16:37 UTC
Permalink
mahimahi [http://community.zenoss.org/people/mahimahi] created the discussion

"Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/61918#61918

--------------------------------------------------------------
I see that you can toggle template binding for specific devices with zendmd using setattr(device, "zDeviceTemplates", bound)
However I wish to do this for a Device Class like what the GUI does for Advanced->Monitoring Templates
Select ethernetCsmacd_64->Devices and go to bottom menu to Override Templates and select a Device Class like /Server/Linux
Now select /Server/Linux under ethernetCsmacd_64 and go to bottom menu and select Toggle Template Binding.

That is the GUI Toggle Template Binding I want to execute in zendmd as the zenpack I created does not enable the binding by default.
Any help in pointing me in the right direction would be great!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61918#61918]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2011-10-19 02:32:53 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/61953#61953

--------------------------------------------------------------
d = dmd.Devices.findDevice('yourDevice')
zList = []
zList = ['Device', 'Test']
d.setZenProperty('zDeviceTemplates', zList)
commit()

Best,
--Shane W. Scott (Hackman238)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61953#61953]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
mahimahi
2011-10-19 04:56:37 UTC
Permalink
mahimahi [http://community.zenoss.org/people/mahimahi] created the discussion

"Re: Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/61940#61940

--------------------------------------------------------------
Shane,

Thanks for the info, but the code you gave me is for individual devices.  As you see from my post, I want to know how to bind for a DeviceClass like /Server/Linux. This is what the GUI does in the Monitor Template.  Any other ideas?

Wes
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61940#61940]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2011-10-19 05:01:45 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/61961#61961

--------------------------------------------------------------
mahimahi:

My mistake. You'll need to:

d=dmd.Devices.getOrganizer('Server')
zList = []
zList = ['Device', 'Test']
d.setZenProperty('zDeviceTemplates', zList)
commit()

Best,
--Shane W. Scott(Hackman238)
  ZCA - http://community.zenoss.org/community/zca/blog http://community.zenoss.org/community/zca/blog
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61961#61961]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Alexander Fortin
2011-11-04 15:42:41 UTC
Permalink
Alexander Fortin [http://community.zenoss.org/people/shaftoe] created the discussion

"Re: Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/62428#62428

--------------------------------------------------------------
What if I want to do the same thing from an URL call? I'm trying:

/zport/dmd/Devices/Server/SSH/Linux/devices/<devicename>/setZenProperty?propname=zDeviceTemplates&propvalue=Device%20CustomTemplate

but it doesn't work, I don't know how to send a "lines" propvalue
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/62428#62428]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Alexander Fortin
2011-11-04 16:19:14 UTC
Permalink
Alexander Fortin [http://community.zenoss.org/people/shaftoe] created the discussion

"Re: Toggle template binding for a Device Class from zendmd?"

To view the discussion, visit: http://community.zenoss.org/message/62430#62430

--------------------------------------------------------------
I've found that it's not documented in the JSON docs but you can use setZenProperty with DeviceRouter and it works
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/62430#62430]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...