2024年8月23日金曜日

MID Server をインストールする方法

MID Server をインストールする方法

概要

MID Server は ServiceNow が提供するサーバインストール型のエージェントです
これをインストールすることでサーバの情報を ServiceNow に保存することができアラートやメトリックスの表示ができるようになります
今回は Ubuntu サーバにインストールしてみました

環境

  • ServiceNow (2024/08/05 時点)
    • Release Washington DC
  • Ubuntu 22.04
  • MID Server 2023-12-20

ダウンロード

All -> MID Server -> Downloads

で deb 版をダウンロードします
300MB ほどあります

インストール

ダウンロードしたらインストールしていきます

All -> Installation Instructions

でドキュメントに飛べます
各種アカウントなどを作成してからインストールしていきます

MID Server 用アカウントの作成

All -> Users から作成します
ユーザの追加方法は過去に紹介している方法と同様です
適切なロールを設定してあげましょう
また作成できたら ServiceNow にログインできることも確認すると良いかなと思います

なおロールには必ず mid_server ロールが割り当たるようにしてください

deb パッケージのインストール

Ubuntu サーバ上に配置して以下を実行していきます

  • scp mid-linux-installer.washingtondc-12-20-2023__patch4-hotfix1-06-10-2024_06-17-2024_2231.linux.x86-64.deb host01:
  • sudo dpkg -i mid-linux-installer.washingtondc-12-20-2023__patch4-hotfix1-06-10-2024_06-17-2024_2231.linux.x86-64.deb

これで /opt/servicenow/mid/agent/ にインストーラが展開されます
なおインストールするにはディスクの容量が 36GB必要になるのでディスクの容量がない場合は別のパスに移動したりシンボリックリンクで対応しても OK です

  • sudo chmod +x /opt/servicenow/mid/agent/installer.sh
  • sudo /opt/servicenow/mid/agent/installer.sh

ServiceNow のインスタンスの URL や先ほど作成した mid_server ロールのユーザを入力します
証明書や相互認証の部分、プロキシに関しては今回はすべて No で OK です

Enter the ServiceNow Instance URL [https://YOUR_INSTANCE.service-now.com/] : https://dev123456.service-now.com
Do you want to use proxy? [Enter Y or N] : N
Do you want to use Mutual Authentication? [Enter Y or N] : N
Validating the Instance URL...
Enter the username for mid user : mid_server_user
Enter the password for mid user:
Validating the Mid-user details...
Username and password are valid.
Do you want to enable Certificate Revocation? [Enter Y or N] : N
Enter the Mid Server Name [My_Linux_Mid_Server] : My_Linux_Mid_Server
Enter the unique name for the service to be created [mid] : mid
Checking for the uniqueness of the service name...
Enter the long name for the service [ServiceNow_MID_Server] : ServiceNow_MID_Server
Enter the Non-Root User Name to run this service :
You have entered the root user. Please specify a non-root user.
Enter the Non-Root User Name to run this service : devops
*******************************************************************************************

    NOTE: A non-root user can manage a service only when the user has required privileges.
  For more information, refer https://hi.service-now.com/kb_view.do?sysparm_article=KB0815542

*******************************************************************************************
Enter yes for the below displayed prompt if you want to start the daemon with out any errors...
The agent directory is /add_disk1/servicenow/mid/agent
Do you want to block all other user access and change the ownership of the entire agent directory at /add_disk1/servicenow/mid/agent based on the mid.shconf_override settings (Enter yes or YES to confirm) ? yes
Block all other user access...
Change user ownership to devops ...
Change group ownership to docker ...
Detected Linux:
Installing the ServiceNow_MID_Server daemon with systemd...
Creating default service file...
Created symlink /etc/systemd/system/multi-user.target.wants/mid.service → /etc/systemd/system/mid.service.
Starting ServiceNow_MID_Server with systemd...
Waiting for ServiceNow_MID_Server...
running: PID:3711838
Mid is running as a service successfully..

起動しているか確認します

  • systemctl status mid
● mid.service - ServiceNow_MID_Server
     Loaded: loaded (/etc/systemd/system/mid.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-08-19 09:47:06 JST; 37s ago
    Process: 3711754 ExecStart=/add_disk1/servicenow/mid/agent/bin/mid.sh start sysd (code=exited, status=0/SUCCESS)
   Main PID: 3711838 (wrapper-linux-x)
      Tasks: 84 (limit: 4513)
     Memory: 258.0M
        CPU: 16.589s
     CGroup: /system.slice/mid.service
             ├─3711838 /add_disk1/servicenow/mid/agent/bin/./wrapper-linux-x86-64 /add_disk1/servicenow/mid/agent/bin/../conf/wrapper.conf wrapper.syslog.ide>
             └─3711883 /add_disk1/servicenow/mid/agent/jre/bin/java -Djava.util.logging.config.file=properties/glide.properties -Dsun.net.maxDatagramSockets=>

Aug 19 09:47:01 host01 mid.sh[3711754]: Starting ServiceNow_MID_Server...
Aug 19 09:47:05 host01 mid.sh[3711754]: Waiting for ServiceNow_MID_Server.......
Aug 19 09:47:06 host01 mid.sh[3711754]: running: PID:3711838

登録されているか確認

All -> MID Servers で確認できます
先ほど登録した MID Server が一覧に表示されることを確認しましょう

検証する

登録したサーバを検証します
先程の登録された MID Server を選択し Related LInks から Validate を選択します

各種確認して Save を選択します

このあと一覧を再度確認して Validated の絡むが Validating -> Yes になれば OK です
うまく Yes にならない場合は MID Server のプロセスを再起動してみましょう

  • sudo systemctl restart mid

ログの場所

/opt/servicenow/mid/agent/logs/agent0.log.0 にあります

最後に

ServiceNow の MID Server を Ubuntu にインストールする方法を紹介しました
MID Server 用のユーザを作成する必要があるのと mid_server というロールを設定するのがポイントです
またインストールするサーバのディスクサイズにも注意しましょう

参考サイト

0 件のコメント:

コメントを投稿