Azure CLI를 사용하여 Microsoft Azure(Web App)에서 Blackbox Exporter 설정
4990 단어 beginnerstutorialmonitoringazure
전제 조건:
리소스 생성:
스크립트
$ResourceGroupName = "suryarg"
$LocationName = "eastus2"
$ACRName = "suryacr"
$ACRUrl = "$ACRName.azurecr.io"
$AppServicePlan = "suryaasp"
$AppServicePlanSku = "S1"
$StorageAccountName = "suryastorageaccountsa"
$StorageAccountSku = "Standard_ZRS"
$StorageAccountShare = "suryasblackboxexporter"
$WebAppName = "suryawablackboxexporter"
#Create App Service Plan
az appservice plan create --resource-group $ResourceGroupName --name $AppServicePlan --is-linux --sku $AppServicePlanSku
#Create a Storage Account
az storage account create --resource-group $ResourceGroupName --name $StorageAccountName --kind StorageV2 --sku $StorageAccountSku
#Create an Storage Account File Share
az storage share-rm create --resource-group $ResourceGroupName --storage-account $StorageAccountName --name $StorageAccountShare --access-tier "TransactionOptimized" --quota 64
#Create an Webapp for blackboxexporter
az webapp create --resource-group $ResourceGroupName --name $WebAppName --plan $AppServicePlan -i "$ACRUrl/blackbox-exporter:SuryaLatest"
#Create Storage Mount for blackboxexporter WebApp
$storageaccountkey = $(az storage account keys list --resource-group $ResourceGroupName --account-name $StorageAccountName --query [0].value -o tsv)
az webapp config storage-account add --resource-group $ResourceGroupName --name $WebAppName --custom-id "config" --storage-type "AzureFiles" --share-name $StorageAccountShare --account-name $StorageAccountName --access-key $storageaccountkey --mount-path "/config/"
#Set an Environment Variable for blackboxexporter WebApp
az webapp config appsettings set --resource-group $ResourceGroupName --name $WebAppName --settings WEBSITES_PORT=9115
#Set an Startup Commmand for blackboxexporter WebApp
az webapp config set --name $WebAppName --resource-group $ResourceGroupName --startup-file `
"--config.file=/config/blackbox.yml"
modules:
http_2xx:
prober: http
http_post_2xx:
prober: http
http:
method: POST
tcp_connect:
prober: tcp
pop3s_banner:
prober: tcp
tcp:
query_response:
- expect: "^+OK"
tls: true
tls_config:
insecure_skip_verify: false
grpc:
prober: grpc
grpc:
tls: true
preferred_ip_protocol: "ip4"
grpc_plain:
prober: grpc
grpc:
tls: false
service: "service1"
ssh_banner:
prober: tcp
tcp:
query_response:
- expect: "^SSH-2.0-"
- send: "SSH-2.0-blackbox-ssh-check"
irc_banner:
prober: tcp
tcp:
query_response:
- send: "NICK prober"
- send: "USER prober prober prober :prober"
- expect: "PING :([^ ]+)"
send: "PONG ${1}"
- expect: "^:[^ ]+ 001"
icmp:
prober: icmp
icmp_ttl5:
prober: icmp
timeout: 5s
icmp:
ttl: 5
출력 :
Reference
이 문제에 관하여(Azure CLI를 사용하여 Microsoft Azure(Web App)에서 Blackbox Exporter 설정), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/suryabhansv/setup-blackbox-exporter-in-microsft-azure-webapp-using-azure-cli-4lec텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)