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?

More than 3 years have passed since last update.

DockerのコンテナにHinemosエージェントを入れて監視してみる

Last updated at Posted at 2022-05-08

背景・目的・読み手

 DockerのコンテナにHinemosマネージャを入れて動かしてみる - Qiitaで立てたマネージャを使って監視ができるかどうかを確認。引き続きDockerのコンテナを使って監視できるかどうか確認してみる。

時間もなかったので上記コンテナにエージェントも突っ込んでセルフ監視させてみる。

Hinemosエージェント導入

必要なモジュールの導入

 vimとrsyslogがなかったので導入しておく。

下準備
rsyslog入れる
# dnf -y install rsyslog

vim入れる
# dnf -y install vim

Hinemosエージェント導入と起動

エージェントインストール
# rpm -ivh hinemos-7.0-agent-7.0.0-1.el.noarch.rpm
Verifying...                          ################################# [100%]
warning: Unable to get systemd shutdown inhibition lock: Unit systemd-logind.service is masked.
Preparing...                          ################################# [100%]
Updating / installing...
   1:hinemos-7.0-agent-0:7.0.0-1.el   ################################# [100%]

vim でAgent.propertiesを編集する(managerAddressにマネージャーのIPアドレスを指定。今回は172.17.0.2)
[root@fed08f920778 /]# vim /opt/hinemos_agent/conf/Agent.properties
(中略)
managerAddress=http://172.17.0.2:8083/HinemosWeb/
(中略)

hinemos_agent起動
# systemctl start hinemos_agent
# systemctl enable hinemos_agent
hinemos_agent.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable hinemos_agent
# systemctl status hinemos_agent
● hinemos_agent.service - SYSV: Hinemos Agent
   Loaded: loaded (/etc/rc.d/init.d/hinemos_agent; generated)
(中略)

snmpd起動
# systemctl start snmpd
# systemctl enable snmpd
● snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
   Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled)
(中略)

ノード登録と監視ジョブ設定

 以下手順を参考に、自分自身をノードとして登録する。
Hinemos 6.1 をインストールしてジョブを実行してみるまで - Qiita

 その後、こちらの手順を参考に、CPU使用率の監視を行う。
Hinemos ver.6.1 入門編② Hinemos ver.6.1で監視してみよう | Hinemos

 どうにか監視できました!
image.png

課題

 アラート検知時刻が標準時刻で表示されるので、JSTに直したい。OSはJSTで動いているのだけど…。

参考文献

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?