---
title: "Google Stackdriver Monitoring Compute Engine セットアップ編 2016年10月 | grasys blog"
url: "https://blog.grasys.io/post/yusukeh/stackdriver_monitoring/"
description: "こんにちはgrasys長谷川です。 今日はStackdriverの記事を書こうと思います。 一応Updateも激しいのでタイトルに年月入れときました。 統合監視ツールの画面っぽくなってきました。 ちょっぴりインシデント管理も兼ねているので、障害履歴とその対応履歴なども追うことができます。 Documentはここ -…"
---

# Google Stackdriver Monitoring Compute Engine セットアップ編 2016年10月

-   ![](/_astro/noicon.CTHOhNiB_1HMs6A.webp)[yusukeh](/authors/yusukeh/)
-   公開日：2016年10月3日
-   カテゴリー：[Tech](/categories/tech/)
-   タグ：[#Compute Engine](/tags/compute-engine/)[#Google Cloud](/tags/google-cloud/)[#Cloud Monitoring](/tags/cloud-monitoring/)[#stackdriver](/tags/stackdriver/)

![Google Stackdriver Monitoring Compute Engine セットアップ編 2016年10月](/_astro/ogp.BXp8oM_-_Zbzzqm.webp)

こんにちはgrasys長谷川です。

今日はStackdriverの記事を書こうと思います。

一応Updateも激しいのでタイトルに年月入れときました。

![Google Stackdriver Monitoring Compute Engine セットアップ編 2016年10月の画面](/_astro/01-stackdriver_dashboard-1024x499-7fa3c15e.C2yV_d7y_Z1Hsx4o.webp)

統合監視ツールの画面っぽくなってきました。

ちょっぴりインシデント管理も兼ねているので、障害履歴とその対応履歴なども追うことができます。

Documentはここ -> [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/)

## Instance 作成

| Parameter | Value |
| --- | --- |
| INSTANCE_NAME | インスタンスの名前になります。適当な名前を |
| IMAGE | gcloud compute images listでCentOS系を選んで下さい。 |
| –scopes | デフォルトの設定を入れてます。 |

Plain textcontent\_copy

```
gcloud compute instances create [INSTANCE_NAME] \
  --zone "us-west1-b" \
  --machine-type "g1-small" \
  --network "default" \
  --maintenance-policy "MIGRATE" \
  --scopes default="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/devstorage.read_only" \
  --image [IMAGE] \
  --boot-disk-size "10" \
  --boot-disk-type "pd-standard" \
  --boot-disk-device-name [INSTANCE_NAME]
```

credentialは説明がめんどいので、今回はscopeで対応します。  
**Cloud Monitoring API**を有効にしてInstanceを構成して下さい。

## Stackdriver Monitoring

stackdriver-agentのinstall

Plain textcontent\_copy

```
curl -O "https://repo.stackdriver.com/stack-install.sh"
sudo bash stack-install.sh --write-gcm
```

## Init

-   /etc/init.d/stackdriver-agent
-   /etc/init.d/stackdriver-extractor

## Directory Tree

Plain textcontent\_copy

```
tree -L 2 /opt/stackdriver/
/opt/stackdriver/
├── collectd
│   ├── bin
│   ├── etc
│   ├── include
│   ├── lib64
│   ├── man
│   ├── sbin
│   └── share
├── extractor
│   ├── bin
│   └── etc
└── stack-config

11 directories, 1 file
```

`/opt/stackdriver`配下に配置されます。

[collectd](https://collectd.org/)がベースになってます。

本家のcollectdもplugin形式になっていて、様々なミドルウェアを監視対象にすることができるのですが  
stackdriverも拡張が可能になっています。

[Stackdriver Monitoring Third-party Applications](https://cloud.google.com/monitoring/agent/plugins/)

2016/10/03現在

以下に対応しているみたいです。

-   Apache web server
-   Cassandra
-   CouchDB
-   Elasticsearch
-   HBase
-   JVM Monitoring
-   Kafka
-   Memcached
-   MongoDB
-   MySQL
-   Nginx
-   PostgreSQL
-   RabbitMQ
-   Redis
-   Riak
-   Tomcat
-   Varnish
-   ZooKeeper

configの追加で対応可能です。

`/opt/stackdriver/collectd/etc/collectd.d`ここに所定の書式で追加すると監視されます。

詳細は[Stackdriver Monitoring Third-party Applications](https://cloud.google.com/monitoring/agent/plugins/)ここのLink先にあります。

## この記事を書いた人

[![](/_astro/yusukeh.BvUd2yKE_1mQ6Fp.webp)](/authors/yusukeh/)

### [yusukeh](/authors/yusukeh/)

Fly high. Think deep. Move fast. Go far.🦅

-   [X](https://x.com/yusukeh "X")
-   [GitHub](https://github.com/yusukeh "GitHub")
-   [Medium](https://medium.com/@yusukeh "Medium")
-   [Facebook](https://www.facebook.com/yusuke.exzm "Facebook")
-   [Instagram](https://www.instagram.com/yusukehasegawa/ "Instagram")
-   [LinkedIn](https://www.linkedin.com/in/hasegawa-yusuke-091b4164/ "LinkedIn")

[プロフィールと記事一覧](/authors/yusukeh/)
