Package Products :: Package DataCollector :: Module SshClient :: Class SshClient
[hide private]
[frames] | no frames]

Class SshClient

source code

                             object --+        
                                      |        
                  BaseClient.BaseClient --+    
                                          |    
  twisted.internet.protocol.Factory --+   |    
                                      |   |    
twisted.internet.protocol.ClientFactory --+    
                                          |    
            CollectorClient.CollectorClient --+
                                              |
                                             SshClient
Known Subclasses:

SSH Collector class to connect to a particular device

Instance Methods [hide private]
 
__init__(self, hostname, ip, port=22, plugins=[], options=None, device=None, datacollector=None, isLoseConnection=False)
Initializer
source code
 
run(self)
Start SSH collection.
source code
 
runCommands(self) source code
 
channelClosed(self) source code
 
serviceStarted(self, sshconn)
Run commands that are in the command queue
source code
 
addCommand(self, commands)
Add a command or commands to queue and open a command channel for each command
source code
 
clientConnectionFailed(self, connector, reason)
If we didn't connect let the modeler know
source code
 
loseConnection(self)
Called when the connection gets closed.
source code

Inherited from CollectorClient.CollectorClient: addResult, clientFinished, commandsFinished, getCommands, getResults, reinitialize

Inherited from BaseClient.BaseClient: stop

Inherited from twisted.internet.protocol.ClientFactory: clientConnectionLost, startedConnecting

Inherited from twisted.internet.protocol.Factory: buildProtocol, doStart, doStop, startFactory, stopFactory

Class Variables [hide private]

Inherited from CollectorClient.CollectorClient: cmdindex, maintainConnection

Inherited from twisted.internet.protocol.Factory: noisy, numPorts, protocol

Method Details [hide private]

__init__(self, hostname, ip, port=22, plugins=[], options=None, device=None, datacollector=None, isLoseConnection=False)
(Constructor)

source code 

Initializer

Parameters:
  • hostname (string) - hostname of the device
  • ip (string) - IP address of the device
  • port (integer) - port number to use to connect to device
  • plugins (list of plugins) - plugins
  • options (list) - options
  • device (string) - name of device
  • datacollector (object) - object
Overrides: BaseClient.BaseClient.__init__

run(self)

source code 

Start SSH collection.

Overrides: BaseClient.BaseClient.run

serviceStarted(self, sshconn)

source code 

Run commands that are in the command queue

Parameters:
  • sshconn (Twisted SSH connection) - connection to create channels on

addCommand(self, commands)

source code 

Add a command or commands to queue and open a command channel for each command

Parameters:
  • commands (list) - commands to run
Overrides: CollectorClient.CollectorClient.addCommand

clientConnectionFailed(self, connector, reason)

source code 

If we didn't connect let the modeler know

Parameters:
  • connector (object) - connector associated with this failure
  • reason (object) - failure object
Overrides: twisted.internet.protocol.ClientFactory.clientConnectionFailed