@@ -64,31 +64,29 @@ To compile for a specific platform, you have to set the GOOS and GOARCH environm
64
64
GOOS=linux GOARCH=amd64 go build -o check_by_powershell main.go
65
65
66
66
## Usage
67
- ./check_by_powershell -h
68
- Usage of check_by_powershell
69
-
70
- This Plugin executes remote commands on Windows machines through the use of WinRM.
71
-
72
- Arguments:
73
- -H, --host string Host name, IP Address of the remote host (default "127.0.0.1")
74
- -p, --port int Port number WinRM (default 5985)
75
- --user string Username of the remote host
76
- --password string Password of the user
77
- --tls Use TLS connection (default: false)
78
- -u, --unsecure Verify the hostname on the returned certificate
79
- --ca string CA certificate
80
- --cert string Client certificate
81
- --key string Client Key
82
- --cmd string Command to execute on the remote machine
83
- --icingacmd string Executes commands of Icinga PowerShell Framework (e.g. Invoke-IcingaCheckCPU)
84
- --auth string Authentication mechanism - NTLM | SSH
85
- --sshhost string SSH Host (mandatory if --auth=SSH)
86
- --sshuser string SSH Username (mandatory if --auth=SSH)
87
- --sshpassword string SSH Password (mandatory if --auth=SSH)
88
- -t, --timeout int Abort the check after n seconds (default 10)
89
- -d, --debug Enable debug mode
90
- -v, --verbose Enable verbose mode
91
- -V, --version Print version and exit
67
+
68
+ ```
69
+ Arguments:
70
+ -H, --host string Host name, IP Address of the remote host (default "127.0.0.1")
71
+ -p, --port int Port number WinRM
72
+ -U, --user string Username of the remote host
73
+ -P, --password string Password of the user
74
+ -k, --insecure Don't verify the hostname on the returned certificate
75
+ --no-tls Don't use a TLS connection, use the HTTP protocol
76
+ --ca string CA certificate
77
+ --cert string Client certificate
78
+ --key string Client Key
79
+ --cmd string Command to execute on the remote machine
80
+ --icingacmd string Executes commands of Icinga PowerShell Framework (e.g. Invoke-IcingaCheckCPU)
81
+ --auth string Authentication mechanism - NTLM | SSH (default "basic")
82
+ --sshhost string SSH Host (mandatory if --auth=SSH)
83
+ --sshuser string SSH Username (mandatory if --auth=SSH)
84
+ --sshpassword string SSH Password (mandatory if --auth=SSH)
85
+ -t, --timeout int Abort the check after n seconds (default 10)
86
+ -d, --debug Enable debug mode
87
+ -v, --verbose Enable verbose mode
88
+ -V, --version Print version and exit
89
+ ```
92
90
93
91
### Execute a script over http
94
92
./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'
@@ -102,4 +100,4 @@ It is necessary that the PowerShell script exits with an exitcode like *exit 2*,
102
100
103
101
[OK] Check package "CPU Load"
104
102
| '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
105
- '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 [...]
103
+ '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 commit comments