Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1.89 KB

File metadata and controls

38 lines (32 loc) · 1.89 KB

GSP089 Cloud Monitoring: Qwik Start

Task 1. Create a Compute Engine instance

  1. Buat vm
    gcloud compute instances create lamp-1-vm --project=qwiklabs-gcp-03-d725e8a32fd9 --zone=us-central1-a --machine-type=n1-standard-2 --network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default --metadata=enable-oslogin=true --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=364430223361-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --tags=http-server --create-disk=auto-delete=yes,boot=yes,device-name=lamp-1-vm,image=projects/debian-cloud/global/images/debian-10-buster-v20230510,mode=rw,size=10,type=projects/qwiklabs-gcp-03-d725e8a32fd9/zones/us-central1-a/diskTypes/pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any

Task 2. Add Apache2 HTTP Server to your instance

  1. Install server
    sudo apt-get update
    sudo apt-get install apache2 php7.0
    sudo service apache2 restart
  2. Instal monitoring agent
    curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh
    sudo bash add-google-cloud-ops-agent-repo.sh --also-install
    sudo systemctl status google-cloud-ops-agent"*"
    sudo apt-get update

Task 3. Create an uptime check

  1. Menu > Monitoring > Uptime Check

Task 4. Create an alerting policy

Task 5. Create a dashboard and chart

Task 6. View your logs

Task 7. Check the uptime check results and triggered alerts