Flint provides out-of-the-box or ready to use workflows for SSH Operations. Here are the details of workflows/Flintbits for SSH protocol-

Flintbox nameLocationSSH Flintbits
flint-utilhttps://github.com/getflint/flint-util.gitflint-util > ssh > operation

Available Flintbits

Perform all standard application operations available through the SSH, Some of them are listed below:

SSH available Flintbits

  • ssh.rb
  • ifconfig.rb
  • systeminfo.rb

SSH

The SSH connector is used to execute commands on a remote host by means of the SSH protocol.

Input and output JSON for the SSH operation

This section illustrates the Flintbit Input and output for SSH operation.

Sample Input JSON for the SSH operation
{
 "connector_name" : "ssh",
 "target" : "localhost",  					             
 "type" : "exec",                   
 "username" : "username",                 
 "password" : "password",                 
 "key-file" : "/home/username/my-ssh-key.txt",                   
 "command" : "command",  
 "timeout" : 60000                                        
}

Flintbit input elements for the SSH operation
ParameterDescriptionrequired
connector_nameName of the SSH Connector to be configured.true
targetHost name or IP-address of the remote machine you wish to connect totrue
typeShell execution is of two types - shell and exec.
  • exec each command will be executed in a separate session as if the command is executed in new command shell
  • shell each command will be executed in the same session as if the command is executed in the same command shell
Default execution type is exec.
false
usernameUsername which will be used to log into remote machine, required for authenticationtrue
passwordPassword associated with the username specified, required for authenticationtrue
key-fileAbsolute file path including file name where the SSH key needs to be saved and resides on localfalse
commandCommand to be executed on the host server machinetrue
timeoutTimeout in milliseconds, taken by the connector to serve the ssh request. Default timeout is 60,000 msfalse
Sample JSON output for the SSH operations
 {
  "meta": {
    "job-id": "job-9da7fc10-1e10-445a-be2c-1b1c4ccf16f7",
    "exit-code": 0,
    "context": "flint-util:ssh:operation:ssh.rb",
    "message": "success",
    "timeout": 60000,
    "timestamp": 1469597337757,
    "status": "complete",
    "content-type": "application/json",
    "username": "admin"
  },
  "output": {
    "result": "/home/anurag\n"
  }
}

 

ifconfig 

Execute ifconfig command.

Input and output JSON for the ifconfig

This section illustrates the Flintbit Input and output for ifconfig.

Sample Input JSON for the  ifconfig
{
 "connector_name" : "ssh",	
 "target" : "localhost",     					             
 "type" : "exec",                    
 "username" : "username",                  
 "password" : "password",                 
 "key-file" : "/home/username/my-ssh-key.txt",                     
 "timeout" : 60000                                        
}

 

Flintbit input elements for the ifconfig
ParameterDescriptionRequired
connector_nameName of the SSH Connector to be configured.true
targetHost name or IP-address of the remote machine you wish to connect totrue
typeShell execution is of two types - shell and exec.
  • exec each command will be executed in a separate session as if the command is executed in new command shell
  • shell each command will be executed in the same session as if the command is executed in the same command shell
Default execution type is exec.
false
usernameUsername which will be used to log into remote machine, required for authenticationtrue
passwordPassword associated with the username specified, required for authenticationtrue
key-fileAbsolute file path including file name where the SSH key needs to be saved and resides on localfalse
commandCommand to be executed on the host server machinetrue
timeoutExecution time of the Flintbit in milliseconds (default timeout is 60000 milloseconds)false
Sample JSON output for the ifconfig
 {
  "meta": {
    "job-id": "job-d1580f14-6aff-42c1-ae90-beef3a2ed6d6",
    "exit-code": 0,
    "context": "flint-util:ssh:operation:ifconfig.rb",
    "message": "success",
    "timeout": 60000,
    "timestamp": 1469596332257,
    "status": "complete",
    "content-type": "application/json",
    "username": "admin"
  },
  "output": {
    "result": "eth0      Link encap:Ethernet  HWaddr 74:d4:35:66:07:e6  \n          UP BROADCAST MULTICAST  MTU:1500  Metric:1\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000 \n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\n\nlo        Link encap:Local Loopback  \n          inet addr:127.0.0.1  Mask:255.0.0.0\n          inet6 addr: ::1/128 Scope:Host\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\n          RX packets:2644 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:2644 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:0 \n          RX bytes:2005142 (2.0 MB)  TX bytes:2005142 (2.0 MB)\n\nwlan0     Link encap:Ethernet  HWaddr ac:f1:df:01:c5:bd  \n          inet addr:192.168.2.169  Bcast:192.168.2.255  Mask:255.255.255.0\n          inet6 addr: fe80::aef1:dfff:fe01:c5bd/64 Scope:Link\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:14691 errors:0 dropped:1 overruns:0 frame:0\n          TX packets:8069 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000 \n          RX bytes:12970916 (12.9 MB)  TX bytes:1017591 (1.0 MB)\n\n"
  }
}

 

systeminfo 

Command to get systeminfo.

Input and output JSON to get systeminfo

This section illustrates the Flintbit Input and output for systeminfo.

Sample Input JSON for the systeminfo
{
 "connector_name" : "ssh",	
 "target" : "localhost",     					             
 "type" : "exec",                    
 "username" : "username",                  
 "password" : "password",                 
 "key-file" : "/home/username/my-ssh-key.txt",                     
 "timeout" : 60000                                        
}
 
Flintbit input elements for the systeminfo
ParameterDescriptionRequired
connector_nameName of the SSH Connector to be configured.true
targetHost name or IP-address of the remote machine you wish to connect totrue
typeShell execution is of two types - shell and exec.
  • exec each command will be executed in a separate session as if the command is executed in new command shell
  • shell each command will be executed in the same session as if the command is executed in the same command shell
Default execution type is exec.
false
usernameUsername which will be used to log into remote machine, required for authenticationtrue
passwordPassword associated with the username specified, required for authentication

true

key-fileAbsolute file path including file name where the SSH key needs to be saved and resides on localfalse
commandCommand to be executed on the host server machinetrue
timeoutExecution time of the Flintbit in milliseconds (default timeout is 60000 milloseconds)false
Sample JSON output for the systeminfo
 {
  "meta": {
    "job-id": "job-9e7ce74a-7e64-4d1c-856a-e48c7835ca7d",
    "exit-code": 0,
    "context": "flint-util:ssh:operation:systeminfo.rb",
    "message": "success",
    "timeout": 60000,
    "timestamp": 1469596848548,
    "status": "complete",
    "content-type": "application/json",
    "username": "admin"
  },
  "output": {
    "result": "Architecture:          x86_64\nCPU op-mode(s):        32-bit, 64-bit\nByte Order:            Little Endian\nCPU(s):                4\nOn-line CPU(s) list:   0-3\nThread(s) per core:    2\nCore(s) per socket:    2\nSocket(s):             1\nNUMA node(s):          1\nVendor ID:             GenuineIntel\nCPU family:            6\nModel:                 58\nStepping:              9\nCPU MHz:               3044.121\nBogoMIPS:              6585.35\nVirtualization:        VT-x\nL1d cache:             32K\nL1i cache:             32K\nL2 cache:              256K\nL3 cache:              3072K\nNUMA node0 CPU(s):     0-3\n"
  }
}

On this page: