Distributed Monitoring System zabbix-3.0.3-Complete installation record (1)

Source: Internet
Author: User
Tags snmp

Installation record of distributed monitoring system Zabbix-3.0.3

Environment description
zabbix-server:192.168.1.30 #zabbix的服务端 (to monitor this machine, you need to configure the Zabbix agent for this machine, as mentioned below)
zabbix-agent:192.168.1.7 #zabbix的客户端 (monitored side, need to configure Zabbix agent, mentioned below)


First, the operation Record of Zabbix-server end (192.168.1.30)

Zabbix Server side to install the LNMP environment in advance (MYSQL,NGINX,PHP5 installation directory is/usr/local)

To create a Zabbix running User:
[Email protected] ~]# Groupadd Zabbix
[Email protected] ~]# useradd-g Zabbix Zabbix

Install Libcurl and NET-SNMP:
[email protected] ~]# Yum install net-snmp-devel curl-devel

Install fping:
[[email protected] ~]# cd/usr/local/src
[[email protected] src]# wget-c/HTTP/ Fping.org/dist/fping-3.4.tar.gz
[[email protected] src]# tar zxvf fping-3.4.tar.gz
[[email  Protected] src]# # CD fping-3.4
[[email protected] fping-3.4]#./configure
[[email protected] fping-3.4]# make && make install
[[email protected] fping-3.4]# chown root:zabbix/usr/local/sbin/ Fping
[[email protected] fping-3.4]# chmod 4710/usr/local/sbin/fping

Install Zabbix Server:
[[email protected] ~]# cd/usr/local/src
[[email protected] src]# wget-c/HTTP/ Sourceforge.net/projects/zabbix/files/zabbix%20latest%20stable/3.0.3/zabbix-3.0.3.tar.gz/download
[[Email  protected] src]# tar zxvf zabbix-3.0.3.tar.gz
[[email protected] src]# cd zabbix-3.0.3
[[email  Protected] zabbix-3.0.3]#./configure--prefix=/usr/local/zabbix--enable-server--enable-agent--with-mysql=/usr/ Local/mysql/bin/mysql_config--with-net-snmp--with-libcurl
[[email protected] zabbix-3.0.3]# Make & & Make install


Zabbix Server configuration and startup
Create Zabbix database and MySQL User:
[[[email protected] ~]# mysql-p
...
Mysql> Create schema Zabbix character set UTF8;
Query OK, 1 row affected (0.05 sec)
mysql> create user ' Zabbix ' @ '% ' identified by ' 123456 ';
Query OK, 0 rows affected (0.16 sec)
Mysql> Grant all on zabbix.* to ' Zabbix ' @ '% ';
Query OK, 0 rows affected (0.03 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)

Import Zabbix Initial data:
Switch to the Zabbix directory, this is the/USR/LOCAL/SRC directory
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# CD zabbix-3.0.3
[[email protected] zabbix-3.0.3] #cd database/mysql/
[Email protected] mysql]# pwd
/usr/local/src/zabbix-3.0.3/database/mysql
[[email protected] mysql]# ls
Data.sql Images.sql Schema.sql
[[email protected] mysql]# mysql-uroot-#登陆mysql for Zabbix initial data import
Mysql> set sql_log_bin=0;
Mysql> source./schema.sql;
Mysql> source./images.sql;
Mysql> source./data.sql;
Mysql> set sql_log_bin=1;

Edit/usr/local/zabbix/etc/zabbix_server.conf:
[[Email protected] ~] #vim/usr/local/zabbix/etc/zabbix_server.conf
Logfile=/usr/local/zabbix/logs/zabbix_server.log
Pidfile=/usr/local/zabbix/logs/zabbix_server.pid
dbhost=192.168.1.30
Dbname=zabbix
Dbuser=zabbix
dbpassword=123456
dbport=3306
Fpinglocation=/usr/local/sbin/fping

Copy the Zabbix_server script from the installation directory and edit:
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# CD zabbix-3.0.3
[email protected] zabbix-3.0.3]# CP misc/init.d/fedora/core5/zabbix_server/etc/init.d/
[Email protected] zabbix-3.0.3]# mkdir-p/usr/local/zabbix/logs
[Email protected] zabbix-3.0.3]# chown-r Zabbix:zabbix/usr/local/zabbix
[Email protected] zabbix-3.0.3]# Vim/etc/init.d/zabbix_server
[Email protected] zabbix-3.0.3]# Cat/etc/init.d/zabbix_server
...
Zabbix_bin= "/usr/local/zabbix/sbin/zabbix_server"
Conf_file= "/usr/local/zabbix/etc/zabbix_server.conf"
...
Start () {
...
Daemon $ZABBIX _bin-c $CONF _file
...
}


Adjust firewall rules (open port 10051):
[Email protected] ~]# Vim/etc/sysconfig/iptables
...
-A input-p tcp-m state--state new-m TCP--dport 10051-j ACCEPT
...

[Email protected] ~]#/etc/init.d/iptables restart

Start Zabbix Server:
[[Email protected] ~]# service zabbix_server start #也可以直接/usr/local/zabbix/sbin/zabbix_server mode
Starting Zabbix Server: [OK]

Stop Zabbix Server:
[[Email protected] ~]# service Zabbix_server stop
Stopping Zabbix Server: [OK]

Configure start-up automatically:
[Email protected] ~]# chkconfig--add zabbix_server
[Email protected] ~]# chkconfig--level zabbix_server on


Zabbix Web front-end
Copy the frontends to the specified Web root in the installation directory:
[Email protected] ~]# mkdir-p/data/www/zabbix
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# CD zabbix-3.0.3
[[email protected] zabbix-3.0.3] #cp-a frontends/php/*/data/www/zabbix/
[Email protected] zabbix-3.0.3]# chown-r Www:www/data/www/zabbix


Nginx Configuration:
[Email protected] ~]# cat/usr/local/nginx/conf/nginx.conf
...
server {
Listen 80;
server_name zabbix.zrwm.com;
Error_log Logs/zabbix_error.log;
Access_log Logs/zabbix_access.log;
Root/data/www/zabbix;
Index index.php index.html index.htm;
Location ~ \.php$ {
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
}
...

PHP.ini configuration:
[Email protected] ~]# Cat/usr/local/php5/etc/php.ini
...
Memory_limit = 128M
Post_max_size = 16M
Max_execution_time = 300
Max_input_time = 300
Session.auto_start = 0; must be 0
Mbstring.func_overload = 2
...
Note: PHP needs to open at least extension: gd,bcmath,ctype,libxml,xmlreader,xmlwriter,session,sockets,mbstring,gettext,mysql
Below, see if the extensions mentioned above are included
[Email protected] ~]#/usr/local/php5/bin/php-m
[PHP Modules]
Bcmath
Core
CType
Curl
Date
Dom
Ereg
FileInfo
Filter
Ftp
Gd
GetText
Hash
Iconv
Json
Libxml
Mbstring
MCrypt
Mysql
Mysqli
Openssl
Pcntl
Pcre
Pdo
Pdo_sqlite
Phar
Posix
Reflection
Session
Shmop
SimpleXML
Soap
Sockets
Spl
Sqlite3
Standard
Sysvsem
Tokenizer
Xml
XmlReader
Xmlrpc
XmlWriter
Zip
Zlib

[Zend Modules]


Access to the Web interface http://zabbix.zrwm.com, the relevant web configuration, the configuration is completed using the Default User admin (password: Zabbix) landing can be.

Second, the operation record of Zabbix client (192.168.1.7)

To install Zabbix, configure the Zabbix agent:
[Email protected] ~]# cd/usr/local/src/
[Email protected] src]# wget-c wget-c http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.3/ Zabbix-3.0.3.tar.gz/download
[Email protected] src]# CD zabbix-3.0.3
[Email protected] zabbix-3.0.3]#/configure--prefix=/usr/local/zabbix--enable-agent
[[email protected] zabbix-3.0.3]# make && make install

[email protected] zabbix-3.0.3]# CP misc/init.d/fedora/core5/zabbix_agentd/etc/init.d/


Configuration zabbix_agentd:
[[email protected] ~]# groupadd Zabbix
[[email protected] ~]# useradd-g Zabbix Zabbix
[[email protected] ~]# mkdir-p/usr/local/zabbix/logs
[[email protected] ~]# Chown Zabbix:zabbix-r/usr/local/zabbix/
[[email protected] ~]# vim/usr/local/zabbix/etc/zabbix_agentd.conf
[[email protected] ~]# cat/usr/local/zabbix/etc/zabbix_agentd.conf
...
Pidfile=/usr/local/zabbix/logs/zabbix_agentd.pid
Logfile=/usr/local/zabbix/logs/zabbix_agentd.log
server=192.168.1.30
listenport=10050
serveractive=192.168.1.30
hostname=192.168.1.7
Timeout=15
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
...


To configure the Zabbix agent startup script:
[Email protected] ~]# CAT/ETC/INIT.D/ZABBIX_AGENTD
...
prog= "Zabbix Agent"
Zabbix_bin= "/usr/local/zabbix/sbin/zabbix_agentd"
Conf_file= "/usr/local/zabbix/etc/zabbix_agentd.conf"
...
Start () {
...
Daemon $ZABBIX _bin-c $CONF _file
...
}
...


Open firewall Port 10050:
[Email protected] ~]# Cat/etc/sysconfig/iptables
...
-A input-p tcp-m state--state new-m TCP--dport 10050-j ACCEPT
...
[Email protected] ~]#/etc/init.d/iptables restart


Start Zabbix_agentd:
[[email protected] ~]#/etc/init.d/zabbix_agentd start
Starting Zabbix Agent: [OK]

Configure start-up automatically:
[Email protected] ~]# chkconfig--add zabbix_agentd
[Email protected] ~]# chkconfig--level zabbix_agentd on


Test whether the Zabbix agent is working properly:
[Email protected] ~]#/usr/local/zabbix/sbin/zabbix_agentd-c/usr/local/zabbix/etc/zabbix_agentd.conf-t System.uptime
System.uptime [u|68301]

To this, zabbix3.0.3 monitoring system of the basic Environment installation complete ~ Follow-up update Zabbix monitoring item added operation record, please expect ~ ~

Distributed Monitoring System zabbix-3.0.3-Complete installation record (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.