0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

監視とは?

0
Posted at

はじめに

死活監視について、死活監視とは何かから実際の運用までザクっと学び直します。

死活監視とは、一言で言うと
対象のコンピュータやプログラムがちゃんと動いているか継続的にチェックすること

コンピュータやプログラムが生きているか死んでいるかを、基本的には定期的にアクティブ監視で定期的に確かめにいきます。
システムの停止や障害早期に検知します。

死活監視の種類

死活監視は大きく分けて「アクティブ監視」と「パッシブ監視」の2種類があります。

1. アクティブ監視

監視側から対象システムに対して問い合わせを行う。

代表的な手法:

  • PING監視:ICMPパケットで疎通確認
  • ポート監視:特定ポートへの接続確認
  • HTTP/HTTPS監視:Webサービスの応答確認

2. パッシブ監視

対象システムから定期的に送られるデータを確認する。

代表的な手法:

  • バッチ処理:バッチ処理中継続的に監視サーバーに通知。
バッチ処理開始!

01:00 OK
01:01 OK
01:02 OK
01:03 ✖ 止まった?

→プロセスが死んだ/フリーズした可能性

比較

項目 アクティブ監視 パッシブ監視
監視方式 監視側から問い合わせ 対象側からの報告を待つ
検知速度 速い やや遅い
ネットワーク負荷 高い 低い
実装の容易さ 簡単 対象側の実装が必要

監視項目

システム運用で監視すべき主な項目は以下の通りです。

監視対象

  • ネットワーク機器:ルーター、スイッチ、ファイアウォール
  • サーバー:Webサーバー、アプリケーションサーバー、DBサーバー
  • その他:監視カメラ、デジタルサイネージなど

基本的な監視項目

監視項目の階層:
├── レイヤー1:ネットワーク疎通(PING)
├── レイヤー2:サービス稼働(ポート監視)
├── レイヤー3:アプリケーション応答(HTTP監視)
└── レイヤー4:レスポンス時間・エラーレート

監視項目の例:

監視項目 確認内容 手法
ネットワーク疎通 機器が応答するか PING監視
サービス稼働 ポートが開いているか ポート監視
Webサービス HTTPレスポンスが返るか HTTP監視
レスポンス時間 応答速度は正常か HTTP監視

実際の運用

死活監視の実施方法は、場合に応じて以下の3つから選択、掛け合わせます。

1. 手動での実施

開発環境や、一時的な確認をする場合。

# PING監視
ping -c 5 example.com

# 結果
# ICMPパケットに対し全て応答がありパケットロスなし。
hinano@Hinanos-MacBook-Air ~ % ping -c 3 google.com 

PING google.com (142.250.21.101): 56 data bytes
64 bytes from 142.250.21.101: icmp_seq=0 ttl=115 time=9.555 ms
64 bytes from 142.250.21.101: icmp_seq=1 ttl=115 time=17.653 ms
64 bytes from 142.250.21.101: icmp_seq=2 ttl=115 time=17.465 ms

--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 9.555/14.891/17.653/3.774 ms

---------------------------------------------------------------
# ポート確認
nc -zv example.com 80

# 結果
# ポート80へのTCP接続に成功している。WEBサーバープロセスが起動し、リクエストを受け付けられる状態。
hinano@Hinanos-MacBook-Air ~ % nc -zv google.com 80 
Connection to google.com port 80 [tcp/http] succeeded!

# 3つのパケットが帰ってきていて、パケットロスはない。正常。

---------------------------------------------------------------

# HTTPステータス確認
curl -I https://example.com

# 結果
# HTTPレスポンス(301)が返ってきてい流。
curl -I google.com         
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Content-Security-Policy-Report-Only: object-src 'none';base-uri 'self';script-src 'nonce-uK7sqaUDFCUPwjiEED5WKg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
Date: Sun, 26 Apr 2026 01:31:22 GMT
Expires: Tue, 26 May 2026 01:31:22 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN

2. 監視ツールの活用

中規模以上の環境で24時間監視、複数ツールの統合監視が必要な場合。

代表的なツール:

  • Zabbix:オープンソースの統合監視
  • Nagios:老舗の監視ツール
# Zabbixの設定例
items:
  - name: ICMP ping
    type: simple_check
    key: icmpping
    delay: 60s
    
  - name: HTTP service
    type: simple_check
    key: net.tcp.service[http]
    delay: 60s

3. クラウドサービスの利用

マネージドサービスや迅速な導入を一旦したい場合。

主なサービス:

  • AWS CloudWatch:AWS環境の監視
  • Azure Monitor:Azure環境の監視
  • GCP Cloud Monitoring:GCP環境の監視

おわりに

死活監視は、システムが 「止まっていないこと」 を確認するための、最も基本的な監視。

参考資料

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?