Archived community.zenoss.org | full text search
Skip navigation
5894 Views 6 Replies Latest reply: May 15, 2009 6:26 AM by zarxcky RSS
sbellows Newbie 2 posts since
May 9, 2007
Currently Being Moderated

May 9, 2009 11:01 PM

Trouble with ssh modeling on 2.4

I am trying to test the new ssh modeling feature of zenoss following the instructions outlined here:

http://www.zenoss.com/community/docs/zenoss-guide/2.4.0/ch03s05.html

I have double checked that the zenoss user can ssh to the target machine using a key located at ~/.ssh/id_dsa. It can also ssh to the target machine using the user and password I have filled out in ZcommandUsername and ZcommandPassword.

Nothing I have tried so far works. The target machine doesn't even show a connection attempt from zenoss.

Output from zenmodeler run -v 10 -d TARGET_MACHINE shows the following error:

DEBUG:zen.SshClient:Creating new SSH connection...
DEBUG:zen.SshClient:Sorted list of authentication methods: ['publickey', 'keyboard-interactive']
DEBUG:zen.SshClient:Attempting method publickey
DEBUG:zen.SshClient:Expanded SSH public key path from zKeyPath ~/.ssh/id_dsa to /home/zenoss/.ssh/id_dsa
/opt/zenoss/Products/DataCollector/SshClient.py:300: DeprecationWarning: getPublicKeyString is deprecated since Twisted Conch 0.9. Use Key.fromString().
return keys.getPublicKeyString( path + '.pub' )
DEBUG:zen.SshClient:Expanded SSH private key path from zKeyPath ~/.ssh/id_dsa to /home/zenoss/.ssh/id_dsa
/opt/zenoss/Products/DataCollector/SshClient.py:393: DeprecationWarning: getPrivateKeyObject is deprecated since Twisted Conch 0.9. Use Key.fromString().
passphrase=self.factory.password))
Traceback (most recent call last):
File "/opt/zenoss/lib/python/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
why = getattr(selectable, method)()
File "/opt/zenoss/lib/python/twisted/internet/tcp.py", line 362, in doRead
return self.protocol.dataReceived(data)
File "/opt/zenoss/lib/python/twisted/conch/ssh/transport.py", line 314, in dataReceived
self.dispatchMessage(messageNum, packet[1:])
File "/opt/zenoss/lib/python/twisted/conch/ssh/transport.py", line 336, in dispatchMessage
messageNum, payload)
--- <exception caught here> ---
File "/opt/zenoss/lib/python/twisted/python/log.py", line 51, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/opt/zenoss/lib/python/twisted/python/log.py", line 36, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/opt/zenoss/lib/python/twisted/python/context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/opt/zenoss/lib/python/twisted/python/context.py", line 37, in callWithContext
return func(*args,**kw)
File "/opt/zenoss/lib/python/twisted/conch/ssh/service.py", line 44, in packetReceived
return f(packet)
File "/opt/zenoss/lib/python/twisted/conch/ssh/userauth.py", line 274, in ssh_USERAUTH_PK_OK
d = self.signData(publicKey, b)
File "/opt/zenoss/lib/python/twisted/conch/ssh/userauth.py", line 370, in signData
key = self.getPrivateKey()
File "/opt/zenoss/Products/DataCollector/SshClient.py", line 393, in getPrivateKey
passphrase=self.factory.password))
File "/opt/zenoss/lib/python/twisted/conch/ssh/keys.py", line 700, in getPrivateKeyObject
return Key.fromFile(filename, passphrase=passphrase).keyObject
File "/opt/zenoss/lib/python/twisted/conch/ssh/keys.py", line 60, in fromFile
return Class.fromString(file(filename, 'rb').read(), type, passphrase)
File "/opt/zenoss/lib/python/twisted/conch/ssh/keys.py", line 88, in fromString
return method(data, passphrase)
File "/opt/zenoss/lib/python/twisted/conch/ssh/keys.py", line 191, in _fromString_PRIVATE_OPENSSH
p, q, g, y, x = decodedKey[1: 6]
exceptions.ValueError: need more than 1 value to unpack
DEBUG:zen.ZenModeler:Running 1 clients
DEBUG:zen.ZenModeler:Running 1 clients

From this point on it just prints out the "Running 1 clients" line until the model process times out.

I have tried this on a fresh install of 2.4.0 on both Centos 5.2 and Ubuntu. The problem persists across both distros.

Any ideas?
  • Brian Edwards ZenossEmployee 14 posts since
    Jul 22, 2008
    Currently Being Moderated
    1. May 11, 2009 5:07 PM (in response to sbellows)
    Trouble with ssh modeling on 2.4
    Try moving the id_dsa file out of ~zenoss/.ssh on the zenoss server. That way it won't attempt key-based authentication, and it might not go down the code path that is causing problems.
  • zarxcky Rank: White Belt 77 posts since
    Apr 15, 2008
    Currently Being Moderated
    2. May 13, 2009 5:20 AM (in response to Brian Edwards)
    The same happens to me
    I used a lot of SSH modeling for most of external servers and the same error came into place whenever I run zenmodeler run -d <device name> -v 10. My error are shown below:

    
    
    DEBUG:zen.SshClient:dome1.lcalink.com host fingerprint: e7:bf:89:74:87:d5:60:e8:9d:1a:eb:aa:6a:c1:b2:f3
    DEBUG:zen.SshClient:Creating new SSH connection...
    DEBUG:zen.SshClient:Sorted list of authentication methods: ['publickey']
    DEBUG:zen.SshClient:Attempting method publickey
    DEBUG:zen.SshClient:Expanded SSH public key path from zKeyPath /home/zenoss/.ssh/id_dsa to /home/zenoss/.ssh/id_dsa
    /usr/local/zenoss/Products/DataCollector/SshClient.py:300: [b]DeprecationWarning: getPublicKeyString is deprecated since Twisted Conch 0.9.  Use Key.fromString().[/b]
      return keys.getPublicKeyString( path + '.pub' )
    DEBUG:zen.ZenModeler:Running 2 clients
    DEBUG:zen.SshClient:Expanded SSH private key path from zKeyPath /home/zenoss/.ssh/id_dsa to /home/zenoss/.ssh/id_dsa
    /usr/local/zenoss/Products/DataCollector/SshClient.py:393: DeprecationWarning: getPrivateKeyObject is deprecated since Twisted Conch 0.9.  Use Key.fromString().
      passphrase=self.factory.password))
    Traceback (most recent call last):
      File "usr/local/zenoss/lib/python/twisted/internet/selectreactor.py", line 146, in _doReadOrWrite
        
      File "usr/local/zenoss/lib/python/twisted/internet/tcp.py", line 362, in doRead
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/transport.py", line 314, in dataReceived
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/transport.py", line 336, in dispatchMessage
        
    --- <exception caught here> ---
      File "usr/local/zenoss/lib/python/twisted/python/log.py", line 51, in callWithLogger
        
      File "usr/local/zenoss/lib/python/twisted/python/log.py", line 36, in callWithContext
        
      File "usr/local/zenoss/lib/python/twisted/python/context.py", line 59, in callWithContext
        
      File "usr/local/zenoss/lib/python/twisted/python/context.py", line 37, in callWithContext
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/service.py", line 44, in packetReceived
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/userauth.py", line 274, in ssh_USERAUTH_PK_OK
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/userauth.py", line 370, in signData
        
      File "/usr/local/zenoss/Products/DataCollector/SshClient.py", line 393, in getPrivateKey
        passphrase=self.factory.password))
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/keys.py", line 700, in getPrivateKeyObject
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/keys.py", line 60, in fromFile
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/keys.py", line 88, in fromString
        
      File "usr/local/zenoss/lib/python/twisted/conch/ssh/keys.py", line 191, in _fromString_PRIVATE_OPENSSH
        
    [b]exceptions.ValueError: need more than 1 value to unpack[/b]
    DEBUG:zen.ZenModeler:Running 2 clients
    DEBUG:zen.ZenModeler:Running 2 clients
    
    


    Using SSH modeling so far working alright with zenoss version up until 2.3.3 before 2.4.0 borked it up.

    Help please?

    Thanks!
  • zarxcky Rank: White Belt 77 posts since
    Apr 15, 2008
    Currently Being Moderated
    3. May 13, 2009 8:20 AM (in response to zarxcky)
    RE: The same happens to me
    Turns out the culprit is the twisted conch libraries.. perhaps the asn1.py parser?

    http://twistedmatrix.com/trac/ticket/3391

    Somebody in the ticket say that the temporary workaround is to "strip the input to get the valid key object back"...

    I am not understanding what's that mean basically..

    So Zen Devs.. help please?
  • Brian Edwards ZenossEmployee 14 posts since
    Jul 22, 2008
    Currently Being Moderated
    4. May 13, 2009 4:52 PM (in response to zarxcky)
    Trouble with ssh modeling on 2.4
    I am a Zenoss developer. Thanks for the pointer to the twisted defect. I'll create a Zenoss defect and add the strip to our code for a future release. In the mean time a work-around is to remove the key file from ~zenoss/.ssh/ on the zenoss server and use password-based authentication by setting zCommandPassword.
  • Brian Edwards ZenossEmployee 14 posts since
    Jul 22, 2008
    Currently Being Moderated
    5. May 13, 2009 5:05 PM (in response to Brian Edwards)
    Trouble with ssh modeling on 2.4
  • zarxcky Rank: White Belt 77 posts since
    Apr 15, 2008
    Currently Being Moderated
    6. May 15, 2009 6:26 AM (in response to Brian Edwards)
    Thanks!
    Thanks Bedwards,

    Since I'm connecting to hundreds of remote servers by means of SSH public_key authentcation, definitely zenoss-2.4.0 need to hold on first. I am reverting to use zenoss-2.3.3 until that issue resolved.

    Thanks for clarifying that.

More Like This

  • Retrieving data ...