Difference between revisions of "Sensuctl"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
https://docs.sensu.io/sensu-go/latest/api/ | https://docs.sensu.io/sensu-go/latest/api/ | ||
+ | |||
+ | Install and Configure | ||
+ | ``` | ||
+ | choco install sensu-cli --version 5.17.0.9112 | ||
+ | sensuctl.exe configure | ||
+ | ``` | ||
+ | |||
+ | # Other ways | ||
+ | |||
+ | Powershell | ||
+ | ``` | ||
+ | $Env:SENSU_API_URL = "https://sensu.example.com" | ||
+ | $Env:SENSU_USER = "admin" | ||
+ | $Env:SENSU_PASS = "" | ||
+ | # $Env:SENSU_ACCESS_TOKEN = (curl.exe -X GET -u $Env:SENSU_USER:$Env:SENSU_PASS -s $Env:SENSU_API_URL/auth) | ||
+ | # write-out $Env:SENSU_ACCESS_TOKEN | ||
+ | |||
+ | $Env:SENSU_INSECURE_SKIP_TLS_VERIFY = "true" | ||
+ | $Env:SENSU_NAMESPACE = "default" | ||
+ | $Env:SENSU_FORMAT = "tabular" | ||
+ | |||
+ | $Env:SENSU_ACCESS_TOKEN = "" | ||
+ | $Env:SENSU_ACCESS_TOKEN_EXPIRES_AT = 1629304680 | ||
+ | $Env:SENSU_REFRESH_TOKEN = "" | ||
+ | # & sensuctl env --shell powershell | Invoke-Expression | ||
+ | # sensuctl cluster status | ||
+ | sensuctl cluster member-list | ||
+ | ``` | ||
+ | |||
+ | Bash | ||
+ | ``` | ||
+ | export SENSU_USER=YOUR_USERNAME && SENSU_PASS=YOUR_PASSWORD | ||
+ | export SENSU_ACCESS_TOKEN=`curl -X GET -u "$SENSU_USER:$SENSU_PASS" -s http://localhost:8080/auth | jq -r ".access_token" | ||
+ | ``` |
Latest revision as of 17:36, 18 August 2021
https://docs.sensu.io/sensu-go/latest/sensuctl/environment-variables/
https://docs.sensu.io/sensu-go/latest/api/
Install and Configure
choco install sensu-cli --version 5.17.0.9112 sensuctl.exe configure
Other ways
Powershell
$Env:SENSU_API_URL = "https://sensu.example.com" $Env:SENSU_USER = "admin" $Env:SENSU_PASS = "" # $Env:SENSU_ACCESS_TOKEN = (curl.exe -X GET -u $Env:SENSU_USER:$Env:SENSU_PASS -s $Env:SENSU_API_URL/auth) # write-out $Env:SENSU_ACCESS_TOKEN $Env:SENSU_INSECURE_SKIP_TLS_VERIFY = "true" $Env:SENSU_NAMESPACE = "default" $Env:SENSU_FORMAT = "tabular" $Env:SENSU_ACCESS_TOKEN = "" $Env:SENSU_ACCESS_TOKEN_EXPIRES_AT = 1629304680 $Env:SENSU_REFRESH_TOKEN = "" # & sensuctl env --shell powershell | Invoke-Expression # sensuctl cluster status sensuctl cluster member-list
Bash
export SENSU_USER=YOUR_USERNAME && SENSU_PASS=YOUR_PASSWORD export SENSU_ACCESS_TOKEN=`curl -X GET -u "$SENSU_USER:$SENSU_PASS" -s http://localhost:8080/auth | jq -r ".access_token"