1
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?

More than 3 years have passed since last update.

Log Analytics Linuxエージェントコマンド集

Last updated at Posted at 2020-11-29

はじめに

エージェント経由でLog Analyticsへログを収集する作業が時たまあるのですが、コマンド忘れがちなのでコマンド集としてまとめておきます。

エージェントのインストール要件

インストール

# 通常のコマンド
wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh && sh onboard_agent.sh -w <YOUR WORKSPACE ID> -s <YOUR WORKSPACE PRIMARY KEY>

# プロキシサーバがある環境下でのコマンド
wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh && sh onboard_agent.sh -p [protocol://]<proxy user>:<proxy password>@<proxyhost>[:port] -w <YOUR WORKSPACE ID> -s <YOUR WORKSPACE PRIMARY KEY>

エージェント再起動

sudo /opt/microsoft/omsagent/bin/service_control restart [<workspace id>]

エージェントのアップグレード

sudo sh ./omsagent-*.universal.x64.sh --upgrade

現在登録されているワークスペースの確認

sudo /opt/microsoft/omsagent/bin/omsadmin.sh -l

Primary Workspace: <workspaceId> Status: Onboarded(OMSAgent Running)

現在登録しているワークスペースを削除

/opt/microsoft/omsagent/bin/omsadmin.sh -X

ワークスペースの再登録

/opt/microsoft/omsagent/bin/omsadmin.sh -w <workspace id> -s <shared key> [-d <top level domain>]

エージェントの削除

wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh && sh onboard_agent.sh --purge

参考

Linux コンピューターに Log Analytics エージェントをインストールする
Windows および Linux での Log Analytics エージェントの管理とメンテナンス
Linux 用 Log Analytics エージェントに関する問題のトラブルシューティング方法

1
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
1
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?