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?

Hinemos ManagerからJob実行してみる

Last updated at Posted at 2025-04-29

こんにちは。
株式会社クラスアクト インフラストラクチャ事業部の大塚です。

前回、前々回とHinemos Manager(Web)とAgentを用意しました。
今回は、ManagerからAgentに対してコマンドジョブを実行してみたいと思います。

手順

HinemosのWebコンソールにログインします。
ログイン後、パースペクティブからリポジトリを選択。
image.png

リポジトリ(ノード)の適当なところで右クリックして、Createを押下。
image.png

AgentのIPアドレスを入力して、Searchボタンを押下します。
image.png

snmpdが正常に稼働していれば、自動で項目が入力されます。
この状態でregisterボタンを押下します。
image.png

一覧に表示されることを確認します。
image.png
image.png

Managerの/etc/hostsにこのノードを登録します。

[root@hinemos ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.1.1 hinemos hinemos
192.168.0.131 hinemos-agent

※しなくてもいけるかもですが、/opt/hinemos/var/log/hinemos_manager.logで"ノード名" is not valid的なメッセージが出てきたので、一応追加してます。

2025-04-29 08:16:00,072 INFO  [com.clustercontrol.hinemosagent.util.AgentConnectUtil] (HinemosScheduler-ram-job-worker-6) setTopic(0, test-commandjob) : agent01 is not valid

パースペクティブからジョブセッティングを押下します。
image.png

Managerを右クリックして、ジョブユニットの作成を押下します。
image.png
test-jobunitという名前で作成します。
image.png

作成したジョブユニットを右クリックして、ジョブネットの作成を押下します。
image.png
test-jobnetという名前で作成します。
image.png

作成したジョブネットを右クリックして、コマンドジョブの作成を押下します。
image.png
test-commandjobという名前で作成します。
コマンドの内容は/tmpフォルダ配下にcommand_test.txtというファイルを作成するというものにしています。
ここで、どのエージェントで実行するのかという事も決めているのですね。
image.png
OKを押下した後、ctrl + sで保存します。
image.png
image.png

実行していきます。
ジョブユニットを右クリックしてRunを押下します。
image.png
Runを押下します。
image.png

実行結果を確認します。
パースペクティブからジョブヒストリーを選択します。
image.png
End StatusがNormalとなっていれば正常終了したことになります。
image.png

Agent側の/tmp配下を見てみます。
確かにファイルが作成されていることがわかりました。
正常に実行されていますね。

[root@hinemos-agent conf]# cd /tmp/
[root@hinemos-agent tmp]# ls
hinemos_test.txt  systemd-private-cef8268b38e747a0b4ae7a0936edc0d3-chronyd.service-ND9U6i
hsperfdata_root   vagrant-shell
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?