Ubuntu 20.04にインフラ監視ツール Checkmkをインストールする

環境
Ubuntu 20.04
checkmk 2.0.0p15

操作方法
1.パッケージをアップデート

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt update; sudo apt upgrade
# sudo apt update; sudo apt upgrade
# sudo apt update; sudo apt upgrade

2.checkmkをダウンロードします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# wget -c https://download.checkmk.com/checkmk/2.0.0p15/check-mk-free-2.0.0p15_0.focal_amd64.deb
# wget -c https://download.checkmk.com/checkmk/2.0.0p15/check-mk-free-2.0.0p15_0.focal_amd64.deb
# wget -c https://download.checkmk.com/checkmk/2.0.0p15/check-mk-free-2.0.0p15_0.focal_amd64.deb

3.checkmkをインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt install -y ./check-mk-free-2.0.0p15_0.focal_amd64.deb
libc-bin (2.31-0ubuntu9.2) のトリガを処理しています ...
php7.4-cli (7.4.3-4ubuntu2.7) のトリガを処理しています ...
php7.4-cgi (7.4.3-4ubuntu2.7) のトリガを処理しています ...
# sudo apt install -y ./check-mk-free-2.0.0p15_0.focal_amd64.deb 略 libc-bin (2.31-0ubuntu9.2) のトリガを処理しています ... php7.4-cli (7.4.3-4ubuntu2.7) のトリガを処理しています ... php7.4-cgi (7.4.3-4ubuntu2.7) のトリガを処理しています ...
# sudo apt install -y ./check-mk-free-2.0.0p15_0.focal_amd64.deb
略
libc-bin (2.31-0ubuntu9.2) のトリガを処理しています ...
php7.4-cli (7.4.3-4ubuntu2.7) のトリガを処理しています ...
php7.4-cgi (7.4.3-4ubuntu2.7) のトリガを処理しています ...

4.omdコマンド動作確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo omd
Usage (called as root):
omd help Show general help
omd setversion VERSION Sets the default version of OMD which will be used by new sites
omd version [SITE] Show version of OMD
omd versions List installed OMD versions
# sudo omd Usage (called as root): omd help Show general help omd setversion VERSION Sets the default version of OMD which will be used by new sites omd version [SITE] Show version of OMD omd versions List installed OMD versions 略
# sudo omd
Usage (called as root):

 omd help                               Show general help
 omd setversion VERSION                 Sets the default version of OMD which will be used by new sites
 omd version    [SITE]                  Show version of OMD
 omd versions                           List installed OMD versions
 略

5.ファイアウォール設定

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo ufw allow Apache
ルールをアップデートしました
ルールをアップデートしました(v6)
# sudo ufw status
状態: 非アクティブ
# sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ファイアウォールはアクティブかつシステムの起動時に有効化されます。
# sudo ufw status
状態: アクティブ
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
Apache ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
Apache (v6) ALLOW Anywhere (v6)
# sudo ufw allow Apache ルールをアップデートしました ルールをアップデートしました(v6) # sudo ufw status 状態: 非アクティブ # sudo ufw enable Command may disrupt existing ssh connections. Proceed with operation (y|n)? y ファイアウォールはアクティブかつシステムの起動時に有効化されます。 # sudo ufw status 状態: アクティブ To Action From -- ------ ---- 22/tcp ALLOW Anywhere Apache ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6) Apache (v6) ALLOW Anywhere (v6)
# sudo ufw allow Apache
ルールをアップデートしました
ルールをアップデートしました(v6)

# sudo ufw status
状態: 非アクティブ
# sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ファイアウォールはアクティブかつシステムの起動時に有効化されます。

# sudo ufw status
状態: アクティブ

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
Apache                     ALLOW       Anywhere
22/tcp (v6)                ALLOW       Anywhere (v6)
Apache (v6)                ALLOW       Anywhere (v6)

6.インスタンスを生成します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo omd create monitors
Adding /opt/omd/sites/monitors/tmp to /etc/fstab.
Creating temporary filesystem /omd/sites/monitors/tmp...OK
Updating core configuration...
Generating configuration for core (type cmc)...Creating helper config...OK
OK
Executing post-create script "01_create-sample-config.py"...OK
Restarting Apache...OK
Created new site monitors with version 2.0.0p15.cfe.
The site can be started with omd start monitors.
The default web UI is available at<span style="color: #0000ff;"> http://ubuntu/monitors/</span>
The admin user for the web applications is <span style="color: #0000ff;">cmkadmin</span> with password: <span style="color: #0000ff;">olpC1g44</span>
For command line administration of the site, log in with 'omd su monitors'.
After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.
# sudo omd create monitors Adding /opt/omd/sites/monitors/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/monitors/tmp...OK Updating core configuration... Generating configuration for core (type cmc)...Creating helper config...OK OK Executing post-create script "01_create-sample-config.py"...OK Restarting Apache...OK Created new site monitors with version 2.0.0p15.cfe. The site can be started with omd start monitors. The default web UI is available at<span style="color: #0000ff;"> http://ubuntu/monitors/</span> The admin user for the web applications is <span style="color: #0000ff;">cmkadmin</span> with password: <span style="color: #0000ff;">olpC1g44</span> For command line administration of the site, log in with 'omd su monitors'. After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.
# sudo omd create monitors
Adding /opt/omd/sites/monitors/tmp to /etc/fstab.
Creating temporary filesystem /omd/sites/monitors/tmp...OK
Updating core configuration...
Generating configuration for core (type cmc)...Creating helper config...OK
OK
Executing post-create script "01_create-sample-config.py"...OK
Restarting Apache...OK
Created new site monitors with version 2.0.0p15.cfe.

  The site can be started with omd start monitors.
  The default web UI is available at http://ubuntu/monitors/

  The admin user for the web applications is cmkadmin with password: olpC1g44
  For command line administration of the site, log in with 'omd su monitors'.
  After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.

説明
http://ubuntu/monitors/
ユーザー名 cmkadmin
パスワード olpC1g44

7.インスタンスを起動します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo omd start monitors
Temporary filesystem already mounted
Starting mkeventd...OK
Starting liveproxyd...OK
Starting mknotifyd...OK
Starting rrdcached...OK
Starting cmc...OK
Starting apache...OK
Starting dcd...OK
Starting redis...OK
Initializing Crontab...OK
# sudo omd start monitors Temporary filesystem already mounted Starting mkeventd...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Initializing Crontab...OK
# sudo omd start monitors
Temporary filesystem already mounted
Starting mkeventd...OK
Starting liveproxyd...OK
Starting mknotifyd...OK
Starting rrdcached...OK
Starting cmc...OK
Starting apache...OK
Starting dcd...OK
Starting redis...OK
Initializing Crontab...OK

8.画面アクセス
http://ubuntu/monitors/
http://192.168.229.131/monitors/
ユーザー名 cmkadmin
パスワード olpC1g44

Ubuntu 20.04

Posted by arkgame