Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and use of zabbix

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Official website: www.zabbix.com

System version: centos6.x

Software version: zabbix-2.4.7.tar.gz

Server IP=192.168.1.100

Client IP=192.168.1.200

Install using source code:

1. Server installation

Pre-installation preparation

Service iptables stop # turn off the firewall or write a firewall rule setenforce 0 # turn off selinuxvim / etc/selinux/config # close selinux SELINUX=disabled in the file

Zabbix is built on lamp or lnmp platform, so you need to install and configure lamp (lnmp) platform before installing zabbix.

# install the lamp platform and related dependencies using yum

Yum-y install gcc gcc-c++ autoconf httpd php php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel

Configure httpd and mysqld services

Chkconfig httpd onchkconfig mysqld on

# after the installation is complete, start configuring the php main configuration file

Vim / etc/php.inidate.timezone = Asia/Shanghai # change time zone to Asia Shanghai max_execution_time = 300 # maximum execution time seconds post_max_size = 32m # maximum upload size max_input_time = 600 # maximum transmission time seconds memory_limit = 128m # memory limit

Create users, groups, database users, databases

# create relevant database information, mysql user root password 123.com, mysql user zabbix

# password 123.com system user zabbix, database zabbix, permissions handed over to mysql user zabbix

Mysqladmin-uroot password 123.comgroupadd zabbixuseradd-M-g zabbix-s / sbin/nologin zabbixService mysqld startmysql-uroot-p123.comcreate database zabbix character set utf8; "grant all on zabbix.* to 'zabbix'@'localhost' identified by' 123.comp.

Put the source code package in the / usr/src/ directory

Cd / usr/src/tar zxf zabbix-2.4.7.tar.gz # imports the table structure and data defined by zabbix and imports them sequentially. Cd zabbix-2.4.7/database/mysqlmysql-uroot-p123.com zabbix

< schema.sqlmysql -uroot -p123.com zabbix < p_w_picpaths.sqlmysql -uroot -p123.com zabbix < data.sqlcd /usr/src/zabbix-2.4.7./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-libcurlmake && make install #常用配置参数说明: --enable-server 安装 Zabbix Server --enable-proxy 安装 Zabbix Proxy --enable-agent 安装 Zabbix Agent --with-mysql 使用 mysql 做数据库服务器 --with-net-snmp 支持 SNMP --with-libcurl 支持 curl,用于 web 监控 安装完成,修改zabbix_server主配置文件 vim /usr/local/zabbix/etc/zabbix_server.conf LogFile=/var/zabbix_server.log #日志文件位置 PidFile=/var/zabbix_server.pid #pid文件位置 DBHost=localhost #数据库主机 DBName=zabbix #zabbix数据库名称 DBUser=zabbix #zabbix数据库用户 DBPassword=123.com #zabbix数据库密码 StartPollers=100 #开启主动模式 StartTrappers=200 #开启主动模式 创建启动文件 cp misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.dchmod +x /etc/rc.d/init.d/zabbix_servervim /etc/rc.d/init.d/zabbix_server BASEDIR=/usr/local/zabbix #修改为zabbix安装位置chkconfig --add zabbix_serverchkconfig zabbix_server on 配置web访问 #apache默认网站根目录是/var/www/html/ mkdir -p /var/www/html/zabbixcp -r frontends/php/* /var/www/html/zabbixchown -R zabbix:zabbix /var/www/html/zabbix 创建zabbix命令 ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/ Zabbix默认监听端口为server端:10051agent端:10050如果想要修改此端口,则修改配置文件: vim /etc/services

Start various services

Service mysqld restartservice httpd startservice zabbix_server start

Install email alarm support

Yum-y install sendmail # Mail transfer Agent yum-y install mailx # Mail server service sendmail restart chkconfig sendmail onecho "zabbix test mail" | mail-s "zabbix" email address # Test whether a message is available

Perform web installation

Browser input: http://192.168.1.100/zabbix

Dependent environment detection

Enter the database name, user, password # you can also log in as the database administrator root and click test connection to test the connection

The fourth step is by default.

Confirm the configuration result

If the step is reported as follows, click download configuration file to download zabbix.conf.php and manually put it under / var/www/html/zabbix/conf/ and click retry to try again.

Enter the user name and password: the user name is admin and the initial password is zabbix

Log in and enter the dashboard

Zabbix server installation completed

2. Installation on the agend

Create a zabbix user

Useradd-M-s / sbin/nologin zabbix

Put the source code package under / usr/src/ # agentd and server are the same package

Cd / usr/src/tar zxf zabbix-2.4.7.tar.gzcd zabbix-2.4.7./configure-- prefix=/usr/local/zabbix-- enable-agentmake & & make install

Modify the zabbix_agentd main configuration file

Vim / usr/local/zabbix/etc/zabbix_agentd.conf Server=192.168.1.100 # server IP address. Multiple IP are separated by commas from ServerActive=192.168.1.100 # active mode data upload addresses Multiple IP separate RefreshActiveChecks=60 with commas # enable active mode BufferSize=10000 # enable active mode MaxLinesPerSecond=200 # enable active mode Timeout=30 # enable active mode Hostname=192.168.1.200 # zabbix client name, it is recommended that unique EnableRemoteCommands=1 # enable remote command UnsafeUserParameters=1 # enable custom key value

Create a zabbix startup file

Cp misc/init.d/fedora/core/zabbix_agentd / etc/rc.d/init.d/chown zabbix:zabbix / etc/rc.d/init.d/zabbix_agentdvim / etc/rc.d/init.d/zabbix_agentd BASEDIR=/usr/local/zabbixchkconfig-- add zabbix_agentdchkconfig zabbix_agentd on

Start the zabbix client

Service zabbix_agentd start

Zabbix client installation is complete

3. Web interface configuration

Sinicization of Web interface

Click profile in the upper right corner of the interface (basic information)

Select chinese (zh_CN) in the language option and click update to change it to a Chinese font

Change passwords and create users

Click basic Information in the upper right corner of the page > users

# Click to change the password to change the user's password without the need for password

Background theme: modify the style of the page

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report