ã¿ãªãããããã«ã¡ã¯ã2022å¹´8æãããµã¼ãã¼ã¯ã¼ã¯ã¹ã«ã¸ã§ã¤ã³ãã¾ããããããã¨ç³ãã¾ãã å½ç¤¾ã®æåã®ã²ã¨ã¤ã«ãã¨ã³ã¸ãã¢ãç©æ¥µçã«ããã°ã§æ å ±çºä¿¡ããã¦ãã¾ããããã¯å½ç¤¾ã®ãã¨ãåºãçããã«ç¥ã£ã¦ãããããã«è¡ã£ã¦ãã¾ãã ãããããã®æåãè¦ç¿ã£ã¦ããã£ããæ¸ãã¦ã¿ããã¨ã«ãã¾ããã
ã¯ããã«
ã¯ããã«
ãã®è¨äºã®æé ãæ§æã«ã¤ãã¦ã¯ãããã¾ã§ãæ¤è¨¼ç®çã§ãã å½ç¤¾ã®ãµã¼ãã¹æä¾æã®æ§ç¯æé ããã·ã¹ãã æ§æã¨ã¯ç°ãªãã¾ãã®ã§ããäºæ¿ãã ããã
対象èªè
ãã®è¨äºã¯ãEC2ãªãã³ã«RDSãã»ã¨ãã©è§¦ã£ããã¨ç¡ãæ¹ããZabbixãã¤ã³ã¹ãã¼ã«ãå®æ½ãããã¨ãªãæ¹ã対象ã«è¨è¼ãã¦ãã¾ãã AWSã®é¨åããåãã®æ¹ã¯ãZabbixã®ã»ããã¢ããé¨åã¾ã§èªã¿é£ã°ãã¦é ãã®ãããããããããã¾ããã
Zabbixã«ã¤ãã¦
Zabbixã¨ã¯
Zabbixã¨ã¯ããªã¼ãã³ã½ã¼ã¹ã®çµ±å管çãã¼ã«ã§ãããããããªã½ã¼ã¹ããæè»ã«ãã¼ã¿ãåéã§ãããªã¢ã«ã¿ã¤ã ã§é害ãæ¤ç¥ã»éç¥ããã¼ã¿ã®å¯è¦åã«ããé«åº¦ãªåæãã§ããçµ±åç£è¦ãã¼ã«ã§ãã 詳細ã¯ãå ¬å¼ãã¼ã ãã¼ã¸ã®è£½åãã¼ã¸ãåç §ãã¦ãã ããã
ã¤ã³ã¹ãã¼ã«ã«å¿ è¦ãªè¦ä»¶ã®ç¢ºèª
詳細ã¯å ¬å¼ããã¥ã¡ã³ããé©å®åç §ãã¾ãããããã¼ã¸ã§ã³6.0ã®ããã¥ã¡ã³ããæ¥æ¬èªçãããããå ¬éããã¦ã¾ãã ç¹ã«è¨è¨ã»ãµã¤ã¸ã³ã°ã«ããã¦ã¯ããã¡ããåèã«ãªãã¨æãã¾ãã
æ¬ããã°ã§ã®æ§æ
ãã®è¨äºã§ã¯ã以ä¸ã®æ§æã§æ§ç¯ãã¦ã¿ã¾ããè¨è¼ã®ãªãé¨åã¯ç¹ã«ãã ããã¯ããã¾ããã
æ§æ
EC2
é ç® | ãã©ã¡ã¼ã¿ |
---|---|
OS | Ubuntu 22.04 |
RDS
é ç® | ãã©ã¡ã¼ã¿ |
---|---|
ã¨ã³ã¸ã³ | MySQL 8.0.x |
Zabbix
é ç® | ãã©ã¡ã¼ã¿ |
---|---|
ãã¼ã¸ã§ã³ | 6.0.x LTS |
æ§ç¯
ã§ã¯ãã£ããæ§ç¯ãé²ãã¦ããã¾ãããã
EC2ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ
ã¾ãã¯AWS ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã«ã¢ã¯ã»ã¹ãããµã¼ãã¹ããEC2ã«ã¢ã¯ã»ã¹ãã¾ãã
EC2ã®ã¤ã³ã¹ã¿ã³ã¹ä¸è¦§ãããå³ä¸ã® ã¤ã³ã¹ã¿ã³ã¹ãèµ·å
ãæ¼ä¸ãã¾ãã
次ã«ã¤ã³ã¹ã¿ã³ã¹åãå ¥åãã¾ãã
次ã«OSã¤ã¡ã¼ã¸ãé¸æãã¾ããããã§ã¯ Ubuntu 22.04
ã§ä½æãé²ãã¾ãã
次ã«ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ããé¸æãã¾ããããã§ã¯ t2.large
ãé¸æãã¦ãã¾ãããåè¿°ã®ã¤ã³ã¹ãã¼ã«è¦ä»¶ã«åããã¦é©åãªãã®ãé¸æãã¦ãã ããã
次ã«ãã¼ãã¢ãæå®ãã¾ããæ¢åã®éµã使ç¨ããå ´åã¯ãã«ãã¦ã³ããé¸æã§ãã¾ãã
ããã§ã¯ æ°ãããã¼ãã¢
ãä½æãã¾ãã
ãã¼ãã¢åã¯ããèªèº«ã§ç®¡çããããååã«ãã¦ãã ãããããã§ã¯ãã¼ãã¢ã®ã¿ã¤ã㯠ED25519
ãå©ç¨ãã¾ãã
åé
ç®ãå
¥åãããããã¼ãã¢ãä½æ
ãæ¼ä¸ãã¾ããç§å¯éµã®ãã¦ã³ãã¼ããå§ã¾ãã®ã§ãé©åã«ä¿ç®¡ãã¾ãããã
次ã«ãããã¯ã¼ã¯è¨å®ã«ã¦ãVPCã¨ã»ãã¥ãªãã£ã°ã«ã¼ããé¸æãã¾ãã ããã§VPCã¯ãããã©ã«ãVPCã使ç¨ãããããç¹ã«é¸æãã¾ããã ã»ãã¥ãªãã£ã°ã«ã¼ãã¯é©åãªãã®ããã«ãã¦ã³ããé¸æãã¾ãã æä½éãSSHã¨Webã¢ã¯ã»ã¹ãå¿ è¦ã«ãªãã¾ãã
ã¹ãã¬ã¼ã¸ã®è¨å®ã¯ãããã©ã«ãã®ã¾ã¾ã§é²ãã¾ãã
ä¸éãè¨å®ãå®äºããããç»é¢å³å´ã®æ¦è¦æ¬ãããã¤ã³ã¹ã¿ã³ã¹ãèµ·å
ãæ¼ä¸ãã¦ãã¤ã³ã¹ã¿ã³ã¹ã®ä½æãã¾ãã
ã¤ã³ã¹ã¿ã³ã¹ä¸è¦§ã«æ»ããã¤ã³ã¹ã¿ã³ã¹ã®ç¶æ
ã å®è¡ä¸
ãã¹ãã¼ã¿ã¹ãã§ãã¯ã 2/2ã®ãã§ãã¯ã«åæ ¼ãã¾ãã
ã¨ãªã£ã¦ãããã¨ã確èªãã¦ãã ããã
以ä¸ã§EC2ã¤ã³ã¹ã¿ã³ã¹ã®ä½æãå®äºã§ãã
RDSãã¼ã¿ãã¼ã¹ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ
次ã«RDSã§DBã¤ã³ã¹ã¿ã³ã¹ãä½æãã¦ããã¾ãã
AWS ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã«ã¢ã¯ã»ã¹ãããµã¼ãã¹ããRDSã«ã¢ã¯ã»ã¹ãã¾ãã
ããã·ã¥ãã¼ãããããã¼ã¿ãã¼ã¹ã®ä½æ
ãæ¼ä¸ãã¦ãã ããã
æ¨æºä½æ
ã§DBã¤ã³ã¹ã¿ã³ã¹ãä½æãã¦ããã¾ãã
次ã«ã¨ã³ã¸ã³ã¿ã¤ããé¸æãã¾ããããã§ã¯ãMySQL
ã§ãã¼ã¸ã§ã³ã¯ 8.0.28
ã¨ãã¾ãã
ç¡æå©ç¨æ
ã§é²ãã¾ãã
次ã«è¨å®ã«ã¦ãåé ç®ãå ¥åãã¾ããå¤æ´ããå ´åã¯ãå¾è¿°ã®ãã¼ã¿ãã¼ã¹ã»ããã¢ããæã«ãã³ãã³ããé©å®ç½®ãæãã¦ãã ããã
ã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ããé¸æãã¾ãã
ã¹ãã¬ã¼ã¸ã®è¨å®ã¯ãããã©ã«ãã®ã¾ã¾ã§é²ãã¾ãã
æ¥ç¶ã®è¨å®ããã¾ããã¯ã³ã¯ãªãã¯ã§æ¥ç¶ããæ¹æ³ãå©ç¨ãã¾ãã ã¤ã³ã¹ã¿ã³ã¹ã¯åé ã§ä½æããEC2ã¤ã³ã¹ã¿ã³ã¹ãæå®ãã¦ãã ããã
ã»ãã¥ãªãã£ã°ã«ã¼ããé©åãªãã®ãé¸æãã¦ãã ããã
èªè¨¼æ¹å¼ã¯ ãã¹ã¯ã¼ãèªè¨¼
ãé¸æãã¾ãã
ä¸éãè¨å®ãå®äºãããããã¼ã¿ãã¼ã¹ã®ä½æ
ãæ¼ä¸ãã¾ãã
ä½æä¸ã¯ãã®ãããªç»é¢ã表示ããã¾ããæ§æã«ãããã¾ãããå®äºããã¾ã§ã«10åè¿ããããå ´åãããã¾ãã
ã¹ãã¼ã¿ã¹ã å©ç¨å¯è½
ã¨ãªãã°ä½æå®äºã§ãã
ãã¼ã¿ãã¼ã¹ã®è©³ç´°ãããã¨ã³ããã¤ã³ã
㨠ãã¼ã
ã確èªãã¦ããã¾ãããã
Zabbix Serverã®ã»ããã¢ãã
SSHã§ã¤ã³ã¹ã¿ã³ã¹ã«ãã°ã¤ã³ããé©å®ã¢ãããã¼ããããã¦ããã¾ãããã
$ sudo su - # apt update # apt upgrade
次ã«ãã©ã¦ã¶ã§Zabbixã®ãµã¤ãã«ã¢ã¯ã»ã¹ãã¾ãã
å³ä¸ã® ãã¦ã³ãã¼ã
ãæ¼ä¸ãã¾ãã
Zabbix Packages ãã ãã©ãããã©ã¼ã ãé¸æãã¾ãã
ãã¼ã¸ãã¹ã¯ãã¼ã«ãããªãã¸ããªã®ç»é²ã¨åããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ã¾ã§è¡ãã¾ãã
次ã«ãC. Create initial database
ã®é
ç®ã§ãããããã§ã¯RDSãå©ç¨ããããã2ãæã®ã³ãã³ããä¿®æ£ããå¿
è¦ãããã¾ãã
ã¾ã1ã¤ç®ã¯ãRDSã®ã¨ã³ããã¤ã³ããæå®ããããä¿®æ£ãã¾ãRDSä½ææã«ãã¹ã¿ã¼ã¦ã¼ã¶ãæå®ãã¦ãããããã¦ã¼ã¶æå®ãå¤æ´ãã¾ãã ãã®å¾ã® ã¯ãªã¨ã¤ããªã©ã¯ããã®ã¾ã¾ã§åé¡ããã¾ããã
# mysql -h ã¨ã³ããã¤ã³ã -u zabbix -p
2ã¤ç®ã®ã¹ãã¼ãã®ã¤ã³ãã¼ãã«ã¤ãã¦ããåæ§ã«ã¨ã³ããã¤ã³ãã®æå®ãå¿ è¦ã«ãªãã¾ããå®è¡å¾ã¯å®äºããã¾ã§ã«å°ãæéããããã¾ãã
# zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -h ã¨ã³ããã¤ã³ã -u zabbix -p zabbix
å®äºãããããã¼ã¸ãã¹ã¯ãã¼ã«ããzabbix_server.conf
ãä¿®æ£ãã¾ãã
DBPassword
ã ãã§ãªããDBHost
ã«ã¦ã¨ã³ããã¤ã³ããæå®ããããä¿®æ£ãã¦ãã ããã
å¤æ´å·®åã¯ä»¥ä¸ã®éãã§ãã
# sdiff -s /etc/zabbix/zabbix_server.conf.org /etc/zabbix/zabbix_server.conf # DBHost=localhost | DBHost=zabbix.****.rds.amazonaws.com # DBPassword= | DBPassword=****
ã»ããã¢ããã¯ä»¥ä¸ã§å®äºã§ãã
Zabbix Webã®æ¥æ¬èªå
ããã©ã«ãã§ã¯ãZabbix Webã¯æ¥æ¬èªå¯¾å¿ãã¦ãã¾ããã以ä¸ã®æé ã§æ¥æ¬èªåãããã¨ãã§ãã¾ãã
# dpkg-reconfigure locales
以ä¸ã®UIã表示ãããã®ã§ãja_JP.UTF-8 UTF-8
ãæ¢ã㦠ã¹ãã¼ã¹ ã§ãã§ãã¯ãå
¥ãã¾ãã
é¸æããããTab 㧠<Ok>
ã«ã«ã¼ã½ã«ãåããã¦ãEnter ãæ¼ä¸ãã¦ãã ããã
以ä¸ã®ç»é¢ã«é·ç§»ãã¾ãã®ã§ãja_JP.UTF-8
ãé¸æãã¦ã<Ok>
ãæ¼ä¸ãã¦ãã ããã
CLIä¸ã«ä»¥ä¸ã®åºåãããã°å®äºã§ãã
Generating locales (this might take a while)... en_US.UTF-8... done ja_JP.UTF-8... done Generation complete.
ã°ã©ãã®æ¥æ¬èªå¯¾å¿
Zabbix Webã®æ¥æ¬èªå¯¾å¿ãè¡ã£ãå ´åãã°ã©ãã®æååããçºçãã¦ãã¾ãã¾ãã 以ä¸ã®æ¹æ³ã§å¯¾å¦ãããã¨ãã§ãã¾ãã ã¾ãã¯ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ããã¾ãã
# apt install fonts-mplus
次ã«ä»¥ä¸ã®ã³ãã³ããå®è¡ãã¾ãã
# update-alternatives --install /usr/share/zabbix/assets/fonts/graphfont.ttf zabbix-frontend-font /usr/share/fonts/truetype/mplus/mplus-2p-regular.ttf 20 update-alternatives: using /usr/share/fonts/truetype/mplus/mplus-2p-regular.ttf to provide /usr/share/zabbix/assets/fonts/graphfont.ttf (zabbix-frontend-font) in auto mode
以ä¸ã®ã³ãã³ããå®è¡ãã¦ãmplus-2p-regular.ttf
ã« *
ãä»ãã¦ãããã¨ã確èªãã¦ãã ãããã¤ãã¦ããã°ãã®ã¾ã¾ <Enter>
ãæ¼ä¸ãã¾ãã
# update-alternatives --config zabbix-frontend-font There are 2 choices for the alternative zabbix-frontend-font (providing /usr/share/zabbix/assets/fonts/graphfont.ttf). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/share/fonts/truetype/mplus/mplus-2p-regular.ttf 20 auto mode 1 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf 10 manual mode 2 /usr/share/fonts/truetype/mplus/mplus-2p-regular.ttf 20 manual mode Press <enter> to keep the current choice[*], or type selection number:
ããã§ã°ã©ãã®æååã対å¿ãå®äºã§ãã ãããå¾ ã¡ããã® Zabbix Web ã®ã»ããã¢ããã¸è¡ãã¾ãããã
Zabbix Webã®ã»ããã¢ãã
ã¾ã㯠ãã¦ã³ãã¼ããã¼ã¸ã®æå¾ã«æ®ã£ã¦ãããåããã»ã¹ã®èµ·åã¨ãã¼ãæã®èµ·åè¨å®ããã¾ãã
次ã«EC2ã¤ã³ã¹ã¿ã³ã¹ã®ãããªãã¯IP ã¾ã㯠ãããªãã¯DNS ã確èªããWebãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ãã¾ãã
http://<ãããªã㯠IP or DNS>/zabbix
ã¢ã¯ã»ã¹ã§ããã¨ã以ä¸ã®ç»é¢ã表示ããã¾ãã
Default language
ã®ãã«ãã¦ã³ãã japanese (ja_JP)
ãé¸æãã Naxt Step
ãæ¼ä¸ãã¾ãã
ãã¹ã¦ã®é
ç®ã OK
ã§ãããã¨ã確èªãã次ã®ã¹ããã
ãæ¼ä¸ãã¾ãã
次ã«ãã¼ã¿ãã¼ã¹ã®æ¥ç¶è¨å®ã§ã¯ããã¼ã¿ãã¼ã¹ãã¹ãã®é
ç®ã§ ã¨ã³ããã¤ã³ã
ãæå®ãã¾ãããã®ä»ã®é
ç®ãé©å®å
¥åãã次ã®ã¹ããã
ãæ¼ä¸ãã¾ãã
次ã®è¨å®ããé©å®å
¥åãã次ã®ã¹ããã
ãæ¼ä¸ãã¾ãã
è¨å®å
容ã確èªããåé¡ãªããã°ã次ã®ã¹ããã
ãæ¼ä¸ãã¾ãã
æå¾ã«ä»¥ä¸ã®ç»é¢ã表示ãããã°ã»ããã¢ããå®äºã§ããçµäº
ãæ¼ä¸ãã¾ãã
ãã°ã¤ã³ç»é¢ã表示ãããããããã©ã«ãã®ã¦ã¼ã¶/ãã¹ã¯ã¼ãã§ãã°ã¤ã³ãã¾ãã
ã¦ã¼ã¶ã¼å | ãã¹ã¯ã¼ã |
---|---|
Admin | zabbix |
ããã·ã¥ãã¼ãã表示ãããã°å®äºã§ãï¼
ã¾ã¨ã
ä»åã¯EC2ã¨RDSãå©ç¨ãã¦ãZabbix 6.0 ã®ç°å¢ãæ§ç¯ãã¦ã¿ã¾ããã Zabbix Server 㨠ãã¼ã¿ãã¼ã¹ãµã¼ã ãåãã¦æ§ç¯ããã¦ããæ¹ãå¤ãã®ã§ã¯ãªãã§ããããã RDSãå©ç¨ãããã¨ã§ããã¼ã¿ãã¼ã¹ãµã¼ã ã«ãããã¡ã³ããã³ã¹ãªã©ã®å·¥æ°ãå¤§å¹ ã«åæ¸ã§ããã®ãã¯ã©ã¦ããµã¼ãã¹ã®ã²ã¨ã¤ã®é åã§ãã å°ãã§ãã¯ã©ã¦ãã®ä¸çã«èå³ãæã£ã¦ããã ããã°å¹¸ãã§ãã
æå¾ã¾ã§èªãã§ããã ãããããã¨ããããã¾ããã
é åª(å·çè¨äºã®ä¸è¦§)
ãªã³ãã¬ããã¯ã©ã¦ãã«è»¢èº«ããã¤ã³ãã©ã¨ã³ã¸ãã¢