Friday, March 29, 2024
GCP Juara GCP Monitoring

Cloud Monitoring: Qwik Start

monitoring

“Cloud Monitoring: Qwik Start”

Daftar Isi

Pengantar

Cloud Monitoring memberikan visibilitas ke dalam kinerja, waktu aktif, dan kesehatan keseluruhan aplikasi yang didukung cloud. Cloud Monitoring mengumpulkan metrik, peristiwa, dan metadata dari Google Cloud, Amazon Web Services, probe uptime yang dihosting, instrumentasi aplikasi, dan berbagai komponen aplikasi umum termasuk Cassandra, Nginx, Apache Web Server, Elasticsearch, dan banyak lainnya. Cloud Monitoring menyerap data tersebut dan menghasilkan wawasan melalui dasbor, bagan, dan peringatan. Peringatan Cloud Monitoring membantu Anda berkolaborasi dengan mengintegrasikan dengan Slack, PagerDuty, HipChat, Campfire, dan lainnya.

Praktikum

Task 1. Create a Compute Engine instance

  • Klik Navigation menu > Compute Engine > VM instances > click Create instance.
  • Isi semua field dengan ketentuan berikut :
  • Klik Create

Task 2. Add Apache2 HTTP Server to your instance

  • Klik SSH pada VM lamp-1-vm
  • Klik Connect
  • Klik Connect without Identity-Aware Prox
  • Update server
sudo apt-get update
sudo apt-get install apache2 php7.0
  • restart service
sudo service apache2 restart

Create a Monitoring Metrics Scope

  • Klik Cloud Console, click Navigation menu Navigation menu icon > Monitoring

Install the Monitoring and Logging agents

  • Install via ssh
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 -y

Task 3. Create an uptime check

  • buka Cloud Console, in the left menu, click Uptime checks, and then click +Create Uptime Check.
  • isi dengan ketentuan berikut
Title: Lamp Uptime Check, then click Next.

Protocol: HTTP

Resource Type: Instance

Applies to: Single, lamp-1-vm

Path: leave at default

Check Frequency: 1 min
  • klik next , klik test , klik create
Baca Juga :  Install Cacti pada Ubuntu 20.04

Task 4. Create an alerting policy

  • Klik left menu, click Alerting, and then click +Create Policy
  • klik Select a metric dropdown , Disable the Show only active resources & metrics
  • Type Network traffic in filter by resource and metric name and click on VM instance > Interface. Select Network traffic (agent.googleapis.com/interface/traffic) and click Apply. Leave all other fields at the default value.
  • Klik next
  • Set the Threshold position to Above threshold, Threshold value to 500 and Advanced Options > Retest window to 1 min. Click Next.
  • Click on the drop down arrow next to Notification Channels, then click on Manage Notification Channels
  • Scroll down the page and click on ADD NEW for Email.
  • In the Create Email Channel dialog box, enter your personal email address in the Email Address field and a Display name.
  • Klik save
  • Go back to the previous Create alerting policy tab
  • Click on Notification Channels again, then click on the Refresh icon to get the display name you mentioned in the previous step.
  • Click on Notification Channels again if necessary, select your Display name and click OK.
  • Add a message in documentation, which will be included in the emailed alert.
  • Mention the Alert name as Inbound Traffic Alert.
  • Klik next
  • Review the alert and click Create Policy.

Task 5. Create a dashboard and chart

  • In the left menu select Dashboards, and then +Create Dashboard.
  • Name the dashboard Cloud Monitoring LAMP Qwik Start Dashboard.

Add the first chart

  • Click the Line option in the Chart library.
  • Name the chart title CPU Load.
  • Click on Resource & Metric dropdown. Disable the Show only active resources & metrics.
  • ype CPU load (1m) in filter by resource and metric name and click on VM instance > Cpu. Select CPU load (1m) and click Apply. Leave all other fields at the default value. Refresh the tab to view the graph.
Baca Juga :  Cara Remove Instance di GCP

Add the second chart

  • Click + Add Chart and select Line option in the Chart library
  • Name this chart Received Packets.
  • Click on Resource & Metric dropdown. Disable the Show only active resources & metrics.
  • Type Received packets in filter by resource and metric name and click on VM instance > Instance. Select Received packets and click Apply. Refresh the tab to view the graph
  • Leave the other fields at their default values. You see the chart data.

Task 6. View your logs

  • Select Navigation menu > Logging > Logs Explorer.
  • Click on Resource.
  • Select VM Instance > lamp-1-vm in the Resource drop-down menu.
  • Click Apply.
  • Leave the other fields with their default values.
  • Click the Stream logs.

Check out what happens when you start and stop the VM instance.

  • Open the Compute Engine window in a new browser window. Select Navigation menu > Compute Engine, right-click VM instances > Open link in new window.
  • Move the Logs Viewer browser window next to the Compute Engine window. This makes it easier to view how changes to the VM are reflected in the logs
  • In the Compute Engine window, select the lamp-1-vm instance, click the three vertical dots at the top of the screen and then click Stop, and then confirm to stop the instance.
  • Watch in the Logs View tab for when the VM is stopped.
  • In the VM instance details window, click the three vertical dots at the top of the screen and then click Start/resume, and then confirm. It will take a few minutes for the instance to re-start. Watch the log messages to monitor the start up.
Baca Juga :  Monitor Environments with Google Cloud Managed Service for Prometheus: Challenge Lab

Task 7. Check the uptime check results and triggered alerts

  • In the Cloud Logging window, select Navigation menu > Monitoring > Uptime checks. This view provides a list of all active uptime checks, and the status of each in different locations.
  • Click the name of the uptime check, Lamp Uptime Check.

Check if alerts have been triggered

  • In the left menu, click Alerting.
  • You see incidents and events listed in the Alerting window.
  • Check your email account. You should see Cloud Monitoring Alerts.

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cloud Monitoring: Qwik Start. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

(Visited 74 times, 1 visits today)

Similar Posts