Skip to content

Commit

Permalink
Update usage in README
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyfrosch committed Sep 7, 2020
1 parent 94ab5ec commit d210755
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,29 @@ To compile for a specific platform, you have to set the GOOS and GOARCH environm
GOOS=linux GOARCH=amd64 go build -o check_by_powershell main.go

## Usage
./check_by_powershell -h
Usage of check_by_powershell

This Plugin executes remote commands on Windows machines through the use of WinRM.

Arguments:
-H, --host string Host name, IP Address of the remote host (default "127.0.0.1")
-p, --port int Port number WinRM (default 5985)
--user string Username of the remote host
--password string Password of the user
--tls Use TLS connection (default: false)
-u, --unsecure Verify the hostname on the returned certificate
--ca string CA certificate
--cert string Client certificate
--key string Client Key
--cmd string Command to execute on the remote machine
--icingacmd string Executes commands of Icinga PowerShell Framework (e.g. Invoke-IcingaCheckCPU)
--auth string Authentication mechanism - NTLM | SSH
--sshhost string SSH Host (mandatory if --auth=SSH)
--sshuser string SSH Username (mandatory if --auth=SSH)
--sshpassword string SSH Password (mandatory if --auth=SSH)
-t, --timeout int Abort the check after n seconds (default 10)
-d, --debug Enable debug mode
-v, --verbose Enable verbose mode
-V, --version Print version and exit

```
Arguments:
-H, --host string Host name, IP Address of the remote host (default "127.0.0.1")
-p, --port int Port number WinRM
-U, --user string Username of the remote host
-P, --password string Password of the user
-k, --insecure Don't verify the hostname on the returned certificate
--no-tls Don't use a TLS connection, use the HTTP protocol
--ca string CA certificate
--cert string Client certificate
--key string Client Key
--cmd string Command to execute on the remote machine
--icingacmd string Executes commands of Icinga PowerShell Framework (e.g. Invoke-IcingaCheckCPU)
--auth string Authentication mechanism - NTLM | SSH (default "basic")
--sshhost string SSH Host (mandatory if --auth=SSH)
--sshuser string SSH Username (mandatory if --auth=SSH)
--sshpassword string SSH Password (mandatory if --auth=SSH)
-t, --timeout int Abort the check after n seconds (default 10)
-d, --debug Enable debug mode
-v, --verbose Enable verbose mode
-V, --version Print version and exit
```

### Execute a script over http
./check_by_powershell -H 192.168.172.217 -p 5985 --cmd "cscript.exe /T:30 /NoLogo C:\Windows\system32\check_time.vbs 1.de.pool.ntp.org 20 240" --user "windowsuser" --password 'secret!pw'
Expand All @@ -102,4 +100,4 @@ It is necessary that the PowerShell script exits with an exitcode like *exit 2*,

[OK] Check package "CPU Load"
| 'core_23_10'=2.31%;;;0;100 'core_23_3'=2.54%;;;0;100 'core_23_15'=2.12%;;;0;100 'core_23_5'=2.39%;;;0;100
'core_23_1'=2.04%;;;0;100 'core_23'=1.93%;;;0;100 'core_2_15'=2.78%;;;0;100 'core_2_10'=2.89%;;;0;100 [...]
'core_23_1'=2.04%;;;0;100 'core_23'=1.93%;;;0;100 'core_2_15'=2.78%;;;0;100 'core_2_10'=2.89%;;;0;100 [...]

0 comments on commit d210755

Please sign in to comment.