Discussion:
Automate Add Device
VirTechSystems
2012-12-17 19:27:39 UTC
Permalink
VirTechSystems [http://community.zenoss.org/people/VirTechSystems] created the discussion

"Automate Add Device"

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

--------------------------------------------------------------
Hey,

I am trying to automate the process of adding a device for monitoring in Zenoss.  My search has led me here, http://community.zenoss.org/message/5437#5437#5437 http://community.zenoss.org/message/5437#5437 , which was most helpful.

However, the devices I need to add can not be resolved by name and I would like the Title of the device to be set to more than the IP address. I can do it manually from the WebUI, so I suspect it can be set somehow.

My URL thus far is, http://zenoss:8080/zport/dmd/DeviceLoader/loadDevice?deviceName=172.16.0.2&devicdPath=/Servers/Windows&productionState=1000 http://zenoss:8080/zport/dmd/DeviceLoader/loadDevice?deviceName=172.16.0.2&devicdPath=/Servers/Windows&productionState=1000

I have tried many combinations of manageIp, title, deviceName as found in ZDeviceLoader.py with no luck.

Is it possible with this command or another command to set the Title of the device (with or without a modification of the .py file)?

I am running Zenoss Core 3.2.1 .

Thanks for your help,

Chris
--------------------------------------------------------------

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

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]
Andrew Kirch
2012-12-17 20:00:42 UTC
Permalink
Andrew Kirch [http://community.zenoss.org/people/akirch] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
I always hate to give this answer, but I came to Zenoss after 4.x was released, and can only really tell you how to do this in 4.x.  New to 4.x is a JSON API.  The API drives both command line, and the UI, meaning that both are now the same. 
With this said, I suggest upgrading to 4.x.  Use a firefox debuggging tool like firebug, and do what you're trying to do in the UI, then pull out the JSON, and modify as needed, and inject it into the commandline.
So there's really awesome ways to extend this as well, since you can have scripts in cfengine, chef, and puppet do this for you as well.  It's also a really easy way to see what JSON calls are being made when you write zenpacks and interact with them.
--------------------------------------------------------------

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

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
2012-12-17 21:06:32 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
VirTechSystems:

wget ' http://zenoss:8080/zport/dmd/DeviceLoader/loadDevice?deviceName=myDeviceFQDN&devicePath=/Server/Windows http://zenoss:8080/zport/dmd/DeviceLoader/loadDevice?deviceName=myDeviceFQDN&devicePath=/Server/Windows'

Careful for typos.

..or consider using the SnmpName Modeler ZenPack to set the title to the hostname returned by SNMP during model time.

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

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

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]
VirTechSystems
2012-12-18 13:09:56 UTC
Permalink
VirTechSystems [http://community.zenoss.org/people/VirTechSystems] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
Unfortunately, the device name can't be resolved via DNS.  Each machine is on a different VLAN/subnet from the Zenoss install.

I am working a different angle, though.

Do you know how I might be able to go about posting/submitting the fields found on this page?

http://zenoss:8080/zport/dmd/Devices/Server/Windows/devices/172.16.0.2/devicedetail http://zenoss:8080/zport/dmd/Devices/Server/Windows/devices/172.16.0.2/devicedetail

Thanks,

Chris
--------------------------------------------------------------

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

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
2012-12-18 16:50:37 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
VirTech:

You can access many of those methods via the device router using the JSON API.

http://community.zenoss.org/docs/DOC-13242 http://community.zenoss.org/docs/DOC-13242

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

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

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]
VirTechSystems
2012-12-18 17:27:32 UTC
Permalink
VirTechSystems [http://community.zenoss.org/people/VirTechSystems] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
I've been working towards using the JSON API, will it not work with 3.x?

There's documentation for it.

http://community.zenoss.org/community/documentation/official_documentation/api http://community.zenoss.org/community/documentation/official_documentation/api

Thanks,

Chris
--------------------------------------------------------------

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

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
2012-12-18 17:28:46 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
Chris:

you can give the JSON API a try in v3, but I think it was rather incomplete back then. Worth a shot.

--Shane
--------------------------------------------------------------

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

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]
VirTechSystems
2012-12-18 17:34:31 UTC
Permalink
VirTechSystems [http://community.zenoss.org/people/VirTechSystems] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
The API has a function to do exactly what I want, so it's worth a try. 

Now, I just have to figure out how to get past the login box.

Thanks

Chris
--------------------------------------------------------------

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

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]
VirTechSystems
2012-12-18 18:47:55 UTC
Permalink
VirTechSystems [http://community.zenoss.org/people/VirTechSystems] created the discussion

"Re: Automate Add Device"

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

--------------------------------------------------------------
JSON works quite nicely for adding the device.

Do you know if there is a way to set the group?

Thanks,

Chris
--------------------------------------------------------------

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

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