Discussion:
Change deviceclass with zenbatchload
thomas
2012-03-15 11:20:01 UTC
Permalink
thomas [http://community.zenoss.org/people/thomas] created the discussion

"Change deviceclass with zenbatchload"

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

--------------------------------------------------------------
Hi

I'm using zenbatchload to auto-discover devices (not 'real' network devices, but devices from a CSV file) and everything is actually working fine, however, I can't seem to get zenbatchload to change the Deviceclass path of existing devices, ie. in my case, I start up with this file (for zenbatchload)

/Devices/Network/myType
dev1 setLocation="/LocA"
dev2 setLocation="/LocB"
/Devices/Network/otherType
dev3 setLocation="/LocC"

this file is loaded, and dev1 and dev2 is in myType and dev3 in otherType. Now a change the input file to this

/Devices/Network/myType
dev2 setLocation="/LocB"
/Devices/Network/otherType
dev3 setLocation="/LocC"
dev1 setLocation="/LocA"

and call zenbatchload. It says that devices are already existing, but it doesn't move dev1 to /Devices/Network/otherType

Can this be done?

Running Zenoss Core 3.2.1

Regards
Thomas
--------------------------------------------------------------

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

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]
jcurry
2012-03-20 18:41:28 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: Change deviceclass with zenbatchload"

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

--------------------------------------------------------------
zenbatchload only loads new devices - hence the message about devices already existing.  I have some bits of scripts to move devices - in my case from the the /Discovered class to a different class. Try this bit of python, either from a script or from zendmd.  It moves all devices in /Discovered to /Server/Linux.  Hopefully that gives you enough ideas to craft what you need?

discoveredClass =  dmd.Devices.Discovered
for device in discoveredClass.getSubDevices():
    discoveredClass.moveDevices('/Server/Linux', device.id)
commit()


Cheers,
Jane
--------------------------------------------------------------

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

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...