Discussion:
Execute user commands as a URL
Tom Catyb
2013-07-17 13:58:31 UTC
Permalink
Tom Catyb [http://community.zenoss.org/people/oldparrothead] created the discussion

"Execute user commands as a URL"

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

--------------------------------------------------------------
Does anyone know the format I would use to execute a user command from an "outside" command line.
If we have a server that will be screening and building commands for execution to various devices.
We would like to be able to execute a shell script through SSH to the zenoss box and then out to the device

Something like a menu from the original device the produces a user command like "reboot" to reboot a server.
We have written a multitude of commands, and would like to incorporate them.
They all work fine from the GUI, but we need to know how to execute them from other places, and I am not having any luck in this arena.


Thanks,
Tom Catyb
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
j053ph4
2013-07-17 15:09:11 UTC
Permalink
j053ph4 [http://community.zenoss.org/people/j053ph4] created the discussion

"Re: Execute user commands as a URL"

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

--------------------------------------------------------------
Tom,

If you know your way around zendmd, it looks like the following methods might help:

device.getUserCommands() - returns a list of "command" objects
device.compile(command,device) - returns the "command line" string

you could write a script to be executed from command line (see http://wiki.zenoss.org/ZenDMD_Tips http://wiki.zenoss.org/ZenDMD_Tips) that would perform the device lookup and return the desired command.

Another option may be to see if the "compile" (or some other) method is available through the JSON API.

Hope this helps,
Joseph
--------------------------------------------------------------

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

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