Discussion:
Zenoss 4.2 - Password fail for custom SSH command
mfallone
2013-01-25 19:43:19 UTC
Permalink
mfallone [http://community.zenoss.org/people/mfallone] created the discussion

"Zenoss 4.2 - Password fail for custom SSH command"

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

--------------------------------------------------------------
I am testing a custom SSH command for Zenoss where I would like to connect into each machine and run a script, the monitored server is already configured for SSH modelling and is reporting stats correctly. 

The custom ssh command I created is:
${device/zCommandProtocol} -vv ${device/zCommandUsername}@${device/manageIp} -p ${device/zCommandPort} uptime

which should just log in and output the uptime.  When running this directly from a command prompt on the Zenoss server it succeeds after I enter in my password, which is expected. 

However, when I run this from the Zenoss UI (Infrastructure > Device > Commands > ssh_test) I receive the error 'permission denied', and the auth.log  on the monitored server shows an invalid password.

I had thought (maybe incorrectly) that Zenoss would use the zCommandPassword when prompted, is this the case? if not how should I go about connecting in using SSH and username/password authentication?
--------------------------------------------------------------

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

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]
jmp242
2013-01-25 20:19:36 UTC
Permalink
jmp242 [http://community.zenoss.org/people/jmp242] created the discussion

"Re: Zenoss 4.2 - Password fail for custom SSH command"

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

--------------------------------------------------------------
Did you select to use SSH? if so, try just using the remote command - i.e.
uptime
If you don't say use SSH, then you can build a command like you are, but you have to also specify ${dev/zCommandPassword} I would think.

--
James Pulver
ZCA Member
LEPP Computer Group
Cornell University
--------------------------------------------------------------

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

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]
mfallone
2013-02-06 17:37:18 UTC
Permalink
mfallone [http://community.zenoss.org/people/mfallone] created the discussion

"Re: Zenoss 4.2 - Password fail for custom SSH command"

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

--------------------------------------------------------------
Thanks for the reply jmp, I was away on vacation so I didn't get to play with this more until now.

I am using SSH, in my devices 'Configuration Properties', zCommandProtocol: ssh. 

Unless I'm misunderstanding, replacing the custom command:
${device/zCommandProtocol} -vv ${device/zCommandUsername}@${device/manageIp} -p ${device/zCommandPort} uptime
to uptime would run locally and not on the remote host.

Further testing shows that replacing ${device/zCommandProtocol} with the path of the binary (/usr/bin/ssh) fails as well.  Finally, where would the zCommandPassword be entered in the ssh command line?  AFAIK there is no place for it.

Adding the -vv command is showing the error:
read_passphrase: can't open /dev/tty: no such device or address

/dev/tty looks to be set correctly (0666) and my zenoss user can execute the same command from the console.

At this point I may set up another utility to test with (sshpass) as it seems to be able to accept the password as a flag

/m
--------------------------------------------------------------

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

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