Update docs

master
René Jochum 4 years ago
parent 2d4eefe5b5
commit a7cf80947d

@ -14,6 +14,16 @@ Local LQL Client
Requires a local lql unix socket.
Examples:
- Fetch first row from the hosts table:
$ lql-api localclient mysite -t hosts -c name -c address -c groups -l 1
- The same with stdin:
$ echo -e "GET hosts\nColumns: name address groups\nLimit: 1" | lql-api localclient mysite
Usage:
lql-api localclient [site] [flags]
@ -49,6 +59,8 @@ Flags:
-s, --socket string Socket (default "/opt/omd/sites/{site}/tmp/run/live")
```
See the Installing docs for it.
### sshclient: SSH LQL Client
```
@ -59,6 +71,16 @@ This version connects to the Check_MK Server by SSH.
If you don't provide ssh-keyfile and ssh-password it will use your local agent.
Examples:
- Fetch first row from the hosts table:
$ lql-api sshclient mysite myinternal.host.name -U mysite -t hosts -c name -c address -c groups -l 1
- The same with stdin:
$ echo -e "GET hosts\nColumns: name address groups\nLimit: 1" | lql-api sshclient mysite myinternal.host.name -U mysite
Usage:
lql-api sshclient [site] [server] [flags]
@ -86,6 +108,16 @@ This version connects to the Check_MK Server by SSH.
If you don't provide ssh-keyfile and ssh-password it will use your local agent.
Examples:
- With Debug and a single connection:
$ lql-api sshserver mysite myinternal.host.name -d -m 1 -x 1 -U mysite
- Without Debug and maximum 5 connections:
$ lql-api sshserver mysite myinternal.host.name -m 1 -x 5 -U mysite
Usage:
lql-api sshserver [site] [server] [flags]

@ -33,7 +33,19 @@ var localClientCmd = &cobra.Command{
Short: "Local LQL Client",
Long: `Local LQL Client
Requires a local lql unix socket.`,
Requires a local lql unix socket.
Examples:
- Fetch first row from the hosts table:
$ lql-api localclient mysite -t hosts -c name -c address -c groups -l 1
- The same with stdin:
$ echo -e "GET hosts\nColumns: name address groups\nLimit: 1" | lql-api localclient mysite
`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
sReplacer := strings.NewReplacer("{site}", args[0])

@ -45,10 +45,21 @@ var sshClientCmd = &cobra.Command{
This version connects to the Check_MK Server by SSH.
If you don't provide ssh-keyfile and ssh-password it will use your local agent.
`,
Examples:
- Fetch first row from the hosts table:
$ lql-api sshclient mysite myinternal.host.name -U mysite -t hosts -c name -c address -c groups -l 1
- The same with stdin:
$ echo -e "GET hosts\nColumns: name address groups\nLimit: 1" | lql-api sshclient mysite myinternal.host.name -U mysite
`,
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
sReplacer := strings.NewReplacer("{site}", args[1])
sReplacer := strings.NewReplacer("{site}", args[0])
destSocket := sReplacer.Replace(cmd.Flag("socket").Value.String())
localSocket := sReplacer.Replace(path.Join(os.TempDir(), "lql-{site}-client.sock"))
var tunnel *myssh.Tunnel

@ -43,7 +43,17 @@ var sshServerCmd = &cobra.Command{
This version connects to the Check_MK Server by SSH.
If you don't provide ssh-keyfile and ssh-password it will use your local agent.
`,
Examples:
- With Debug and a single connection:
$ lql-api sshserver mysite myinternal.host.name -d -m 1 -x 1 -U mysite
- Without Debug and maximum 5 connections:
$ lql-api sshserver mysite myinternal.host.name -m 1 -x 5 -U mysite
`,
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {

Loading…
Cancel
Save