LoginSignup
2
0

More than 3 years have passed since last update.

[OCI] イベント・サービスと通知を使用してADBインスタンス起動通知

Last updated at Posted at 2020-09-18

イベント・サービスと通知を使用してADBインスタンス起動通知

Oracle Cloudにおいて
ComputeやAutonomous Databaseなどの起動をスケジュールしており、起動したことを通知することをOCI イベント・サービスと通知サービスを使用して実装してみた。
image.png

※ イベント・サービス の アクション には、アクション・タイプ として ストリーミング / 通知 / ファンクション の設定が可能です。
※ 今回は 通知 を利用してメール通知します。
※ イベント・タイプ は、Autonomous Database – Start End を設定します。

作業ステップ

  • 「通知」の設定
    • トピックの作成
    • サブスクリプションの作成・有効化
  • イベント・ルールの設定
    • ルールの作成
  • 動作確認

「通知」の設定

「通知」方法として電子メールを使用する「通知」の設定

  1. Webコンソール のメニューから 「通知」 を選択

image.png

2.「トピックの作成」 をクリック
image.png

3.「トピックの作成」

  • 「名前」 を入力
  • 「説明」 を入力(任意)
  • 「作成」 をクリック

image.png

サブスクリプションの作成

  1. トピックの詳細画面で「サブスクリプションの作成」 をクリック
    image.png

  2. 「サブスクリプションの作成」
    image.png

    • 「プロトコル」 で「電子メール」を選択
      image.png
    • 「電子メール」に配信先メールアドレスを入力
    • 「作成」 をクリック

サブスクリプションの有効化

①. ステータスが「PENDING(確認待ち)」になっていることを確認

image.png

②. 電子メール通知の有効化

  • Confirmation Mail のメールを確認
  • 「Confirm subscription」リンクをクリック image.png
  • 「Confirm Confirmed」の画面確認

    image.png
    ③. ステータスが「ACTIVE」になっていることを確認(「通知」の設定が完了)
    image.png

イベント・サービスの設定

「Autonomous Database – Start End」のイベントが発生した際に電子メールを使用する「通知」を呼び出す設定

①. Webコンソール のメニューから 「イベント・サービス」 を選択
image.png

②.「ルールの作成」 をクリック
image.png

③.「ルールの作成」
1. 「表示名」 にルールの名前を入力
2. 「説明」 を入力
image.png
3. 条件に「イベント・タイプ」を選択
4. サービス名に「Database」を選択
5. イベント・タイプ で「Autonomous Database – Start End」 を選択
image.png
6. アクション・タイプで「通知」を選択
7. 通知コンパートメントで通知を作成したコンパートメントを選択
8. トピックに通知で作成したトピックを選択
9. 「ルールの作成」をクリック
image.png

設定のテスト

(別途作成した)Autonomous Database を起動
image.png

※ 同一リージョン 内で対象としたコンパートメント配下で、Autonomous Database を起動
※イベント の対象リソースに関しては、 ルール作成や編集画面で、Condition を追加し、Attribute を選択することで、名前などで絞り込むことも可能

「通知」サービスからのメール例

image.png

「イベント・サービス」メトリックの確認

「配信されたイベント」がカウントされていることを確認

image.png

おわりに

イベント・サービスと通知を使用してAutonomous Databaseインスタンスが起動した際に電子メール通知を確認することができた。

参考情報

Database Container Database Exadata Infrastructure
Automatic Failover Begin-End
Change Compartment Begin-End
Create Backup Begin-End Begin-End
Create Begin-End Begin-End Begin-End
Disable Data Guard Begin-End
Enable Data Guard Begin-End
Manual Failover Begin-End
Peer Database Provisioning Begin-End
Restore Begin-End Begin-End
Start Begin-End
Stop Begin-End
Switchover Begin-End
Terminate Begin-End Begin-End Begin-End
Update Begin-End Begin-End Begin-End
Upgrade Begin-End
Change Compartment ✔️ ✔️
Free Database Automatic Stop Reminder ✔️
Free Database Automatically Stopped ✔️
Free Database Automatic Termination Reminder ✔️
Free Database Automatically Terminated ✔️
Maintenance Begin-End
Maintenance Reminder ✔️ ✔️
Maintenance Scheduled ✔️ ✔️
Restart Begin-End

As of 2020/09/17

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0