Releases: katzer/ski
1.5.2
What's new
Released at: 27.08.2024
-
Use SSH Agent instead of
$ORBIT_KEY
for authentication. -
Run command in a local shell for planets of type other then server or database.
-
Compiled binary for OSX build with MacOSX11.3 SDK.
-
Added binary for
arm64-apple-darwin19
target. -
Upgraded to mruby 3.2.0
1.5.1
What's new
Released at: 18.03.2020
-
Singularized folder names.
-
Fixed potential memory leaks.
-
Compiled with
MRB_WITHOUT_FLOAT
. -
Compiled binary for OSX build with MacOSX10.15 SDK.
-
Upgraded to mruby 2.1.0
1.5.0
What's new
Released at: 13.08.2019
-
Added support for
ECDSA
for both key exchange and host key algorithms -
Compiled binary for OSX build with MacOSX10.13 SDK (Darwin17)
-
Upgraded to mruby 2.0.1
1.4.7
1.4.6
Whats new
Tool has been fully reworked.
$ ski -h
usage: ski [options...] matchers...
Options:
-c, --command Execute command and return result
-s, --script Execute script and return result
-t, --template Template to be used to transform the output
-j, --job Execute job specified in file
-n, --no-color Print errors without colors
-p, --pretty Pretty print output as a table
-w, --width Width of output column in characters
-h, --help This help text
-v, --version Show version number
Commands
Execute shell commands:
$ ski -c 'echo Greetings from $PACKAGE_NAME' mars pluto
Greetings from Mars
Greetings from Pluto
Execute shell scripts:
$ ski -s greet.sh mars pluto
Execute SQL commands:
$ ski -c 'SELECT * FROM DUAL' db
D
-
X
Execute SQL scripts:
$ ski -s dummy.sql db
Pretty table output:
$ ski -p -c env localhost
+-----+-----------+--------+----------------+------+--------------------------------------------------------+
| ski -p -c env localhost |
+-----+-----------+--------+----------------+------+--------------------------------------------------------+
| NR. | ID | TYPE | CONNECTION | NAME | OUTPUT |
+-----+-----------+--------+----------------+------+--------------------------------------------------------+
| 1. | localhost | server | root@localhost | Host | SSH_CONNECTION=127.0.0.1 49154 127.0.0.1 22 |
| | | | | | USER=root |
| | | | | | PWD=/root |
| | | | | | HOME=/root |
| | | | | | SSH_CLIENT=127.0.0.1 49154 22 |
| | | | | | MAIL=/var/mail/root |
| | | | | | SHELL=/bin/bash |
| | | | | | SHLVL=1 |
| | | | | | LOGNAME=root |
| | | | | | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
| | | | | | _=/usr/bin/env |
+-----+-----------+--------+----------------+------+--------------------------------------------------------+
Templates
Execute a shell or SQL command or script and convert the output based on a [TextFSM][textfsm] template.
$ ski -s vparams.sql -t vparams db
The SQL script could look like this:
SET PAGESIZE 0
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 18000
SET WRAP OFF
SET FEEDBACK OFF
SET ECHO OFF
SET VERIFY OFF
SET HEADING OFF
SET TAB OFF
SET COLSEP ' , '
SELECT NUM, NAME, VALUE FROM V$PARAMETER WHERE NUM IN (526, 530);
The template file could look like this:
$ cat $ORBIT_HOME/templates/vparams.textfsm
Value Num (\d+)
Value Name (\S*)
Value Value (\S*)
Start
^ *${Num}[ |,]*${Name}[ |,]*${Value} -> Record
Jobs
Bundle command-line arguments to a job to save the report output.
$ ski -j vparams
The job file could look like this:
$ cat $ORBIT_HOME/jobs/vparams.skijob
-s vparam.sql -t vparam db
The report result could look like this:
$ cat $ORBIT_HOME/reports/vparams/1531410936.skirep
1531410936
[["Num", "int"], ["Name", "string"], ["Value", "string"]]
["db","Operativ DB",true,["526", "optimizer_adaptive_plans", "FALSE"]]
["db","Operativ DB",true,["530", "optimizer_adaptive_statistics", "FALSE"]]
1.4.4
0.9.1
Whats new
- Renamed the Project from goo to ski
- Extended functionality, so SQL commands and scripts can be executed on database-type planets
- Supports formatting output via a template into JSON format via the -t flag.
Without formatting:
$ ski -s="showver.sh" app
willywonka version check 2.1
-----------------------
willywonka blueberrychocolate factory London OompaLoompa_Headquarters
-[binaries]---------------------------------------------------------------------
gateway 4.6.1.1 (build time Oct 21 2015 10:35:11)
telhandlerkm 4.6.0.2 (build time Oct 13 2016 12:00:31)
...
With formatting:
$ ski -s="showver.sh" -t="perlver_template" app
[
["willywonka_version", "Section", "Suse", "UnixVersion", "UnixPatch", "Key", "Value", "Key2", "Value2", "Os", "OracleDb"],
["2.1", "", "", "", "", "", "", "", "", "", ""],
["", "binaries", "", "", "", "", "", "", "", "", ""],
...
]
- Supports formatting output into a prettyprinted ascii-table via the -p flag.
$ ski -s="showver.sh" -t="perlver_template" -p app
| willywonka_version | Section | gateway |
-----------------------------------------------------------------------------
| 2.1 | binaries | 4.6.1.1 (build time Oct 21 2015 10:35:11) |
- Supports loading the users bash profile fur bash remote bash executions.
- Creates a logfile and writes down whats happening.
logfile.log:
[34mINFO[0m[2017-02-15 15:04:56] Started with args: [./ski -s=shover.sh app]
[31mFATA[0m[2017-02-15 15:04:56] open /root/code/bintest/testFolder/scripts/shover.sh: no such file or directory
Additional info: called from uploadFile. Keypath: /.ssh/orbit.key
[34mINFO[0m[2017-02-15 15:05:17] Started with args: [./ski -s=showver.sh app]
- Looks for ssh-keyfile called orbit.key at ../config/ssh/ if no ORBIT_KEY enviromental variable is provided.
- Scripts to be executed need to be saved in ../scripts/
- Templates to be used need to be saved in ../templates/
0.9
Whats new
- Added multi-planet-execution-support
- Added option -s="pathToScript" to specify a bash script to be uploaded and executed on a planet
- Added option -p for prettyprinting the output in a neat, readable manner
- Changed the ssh authentification handling in a way that goo looks for a keyfile at $ORBIT_KEY rather than relying on the keyfile being managed by the ssh-manager