设为首页 收藏本站
查看: 1067|回复: 0

[经验分享] Install Zabbix 3.4

[复制链接]

尚未签到

发表于 2019-1-18 12:04:51 | 显示全部楼层 |阅读模式
  Install Zabbix 3.4 which is an enterpriseopen source monitoring system.
  It's possible to monitor not only Linuxbut Windows, Solaris, IBM AIX and others.
[1]  On this example, It based on that SELinux is Permissive or Disabled.
[2]  Install Apache httpd, refer to here.
[3]  Install PHP, refer to here.
[4]  Install MariaDB server, refer to here.
[5]Install some other required packages and Zabbix repository.

[root@dlp ~]#
yum -y install php-mysql php-gd php-xml php-bcmath
[root@dlp ~]#
yum -y install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
[6]Install Zabbix server.
[root@dlp ~]#
yum -y install zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-agent
[7]Create a database for Zabbix.
[root@dlp ~]#
mysql -u root -p
Enter password:
     Welcome to the MariaDB monitor.    Commands end with ; or \g.
     Your MariaDB connection id is 10
     Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB   Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear   the current input statement.
MariaDB [(none)]>
create database zabbix;
Query OK, 1 row affected   (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to   zabbix@'localhost' identified by 'password';
Query OK, 0 rows affected   (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'%'   identified by 'password';
Query OK, 0 rows affected   (0.00 sec)
MariaDB [(none)]>
flush privileges;
Query OK, 0 rows affected   (0.00 sec)
MariaDB [(none)]>
exit
Bye
[root@dlp ~]#
  cd /usr/share/doc/zabbix-server-mysql-*/
[root@dlp zabbix-server-mysql-3.4.0]#
gunzip create.sql.gz
[root@dlp zabbix-server-mysql-3.4.0]#
mysql -u root -p zabbix < create.sql
Enter password:
[8]Configure and start Zabbix Server.
[root@dlp ~]#
vi /etc/zabbix/zabbix_server.conf
# line 90: add
DBHost=localhost
# line 124: add DB password for Zabbix
DBPassword=password
[root@dlp ~]#
systemctl start zabbix-server
[root@dlp ~]#
systemctl enable zabbix-server
[9]If Firewalld is running, allow Zabbix related ports.
[root@dlp ~]#
firewall-cmd --add-service={http,https} --permanent
success
[root@dlp ~]#
firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
success
[root@dlp ~]#
firewall-cmd --reload
success
[10]Configure and start Zabbix Agent to monitor Zabbix Server itself.
[root@dlp ~]#
vi /etc/zabbix/zabbix_agentd.conf
# line 97: specify Zabbix server
Server=
127.0.0.1
# line 138: specify Zabbix server
ServerActive=
127.0.0.1
# line 147: change to the own hostname
Hostname=
dlp.srv.world
[root@dlp ~]#
systemctl start zabbix-agent
[root@dlp ~]#
systemctl enable zabbix-agent
[11]Change httpd settings like follows.
[root@dlp ~]#
vi /etc/httpd/conf.d/zabbix.conf
# line 10: add access permittion for Zabbix Web frontend
#
Require all granted
Require ip 127.0.0.1 10.0.0.0/24
# line 19: uncomment and change to your timezone
php_value date.timezone
Asia/Tokyo
[root@dlp ~]#
systemctl restart httpd

  Zabbix 3.4 : Initial Setup
  This is the Initial Setup for Zabbix server.
[1]Access to the [http://(Zabbix server's hostname or IP address)/zabbix/] from a client which is in the network allowed by Zabbix server. Then, Zabbix start page is displayed, Click [Next step] to proceed.
DSC0000.png
[2]Make sure all items are [OK], then proceed to next.
DSC0001.png
[3]This is the databse settings section. Change the default setting on [User] field to [zabbix] and input DB password for it.
DSC0002.png
[4]This is the connection settings to Zabbix server. If it's local one, it's OK with keeping default. But It had better to change [Name] field to any name you like.
DSC0003.png
[5]This is the confirmation of previous settings, proceed to next if all is OK.
DSC0004.png
[6]Click [Finish] to complete initial setup.
DSC0005.png
[7]This is the login page. It's possible to login with the username [admin], initial password [zabbix].
DSC0006.png
[8]Just logined. This is the index of Zabbix administration site.
DSC0007.png
  Zabbix 3.4 : Change admin password
  Change admin password first. And also set admin email address for notifications.

[1]Login to Zabbix admin site with admin user and click the human-icon which is on the upper-right.
DSC0008.png
[2]Click [Change Password].
DSC0009.png
[3]Input a password you'd like to change and click [Update] to change password. By the way, this example is English displayed but if you'd like to change display language, it's possible to select it on [Language] field.
DSC00010.png
[4]Come to the [Profile] screen again and move to [Media] tab and click [Add] button.
DSC00011.png
[5]Input an admin email address and click [Add] button.
DSC00012.png
[6]Click [Update] button to finish.
DSC00013.png
  Zabbix 3.4 : Set Monitoring Target Host

  Set Monitoring Target Host.
[1]Login to Zabbix admin site with admin user and click [Configuration] - [Hosts]. The localhost which Zabbix Agent has been installed is displayed like follows, check a box on it and click [Enable] button.
DSC00014.png
[2]The [Status] is turned to [enabled] and the server is monitored.
DSC00015.png
[3]After few miniutes later, monitoring data is collected like follows. The following screen is on [Monitoring] - [Screens].
DSC00016.png
  Zabbix 3.4 : Set SMTP for Notifications
  Set SMTP server to send mail notifications.

[1]Login to Zabbix admin site with admin user and move to [Administration] - [Media Types] tab and then, click [Email] button.
DSC00017.png
[2]Set SMTP server's info you'd like to use like follows and click [Update] button.
DSC00018.png
[3]Make sure SMTP server is normally changed on Details field.
DSC00019.png
  Zabbix 3.4 : Notification email setting
  Many items are configured on the defaults' template but it's not set to send notifications by default, so set it like follows.

[1]  Set Zabbix admin's email address, and Set SMTP server setting first.
[2]Login to Zabbix admin site with admin user and move to [Configuration] - [Actions] tab. An action which notifications are sent is defined by default like follows, so click [Disabled] to turn [Enabled].
DSC00020.png
[3]Notifications are enabled. Default recipients is just the Zabbix admin group.
DSC00021.png
[4]If a value is over from a value set as a threshold, a notification is sent like following example.

From root@localhost.srv.world  Fri Aug 25 18:05:01 2017
     Return-Path:
     X-Original-To: root@localhost
     Delivered-To: root@localhost.srv.world
     From:
     To:
     Date: Fri, 25 Aug 2017 19:05:01 +0900
     Subject: Problem: Zabbix agent on Zabbix server is unreachable for 5   minutes
     Content-Type: text/plain; charset=&quot;UTF-8&quot;
     Status: R

Problem started at 19:05:00 on 2017.08.25
     Problem name: Zabbix agent on Zabbix server is unreachable for 5   minutes
     Host: Zabbix server
     Severity: Average

Original problem ID: 18
  
[5]To click the action name, it can see details.
DSC00022.png
[6]It's possible to edit notification messages on [Operations] tab.
DSC00023.png
[7]It's possible to edit recovery messages on [Recovery Operations] tab.
DSC00024.png
  






运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-664792-1-1.html 上篇帖子: zabbix监控web页面,以及告警配置 下篇帖子: 通过Zabbix API 添加host
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表