zabbix process composition
@zabbix_get zabbix tool, a separate command, usually executed on the server or proxy side. The user obtains the monitored data, which is usually used for troubleshooting. For example, if the memory data of the client cannot be obtained on the server side, we can use zabbix_get to obtain the content of the client for troubleshooting.
@zabbix_sender zabbix tool for sending data to server or proxy. It is usually used for long-running checks and is used in conjunction with trapper. In the living environment, some very time-consuming checks often cause zabbix to time out. So after the script is executed, use the sender to actively submit the data.
@zabbix_proxy proxy daemon. The function is similar to the server, the only difference is that it is just a transit station, and he needs to submit/submit the collected data to the server. Generally, the environment across the computer room area needs to use proxy
@zabbix_java_gateway A feature introduced after zabbix2.0. As the name suggests: Java network management, similar to agend, but only in java. It should be noted that she can only actively obtain data, and the data will eventually be given to the server or proxy.
@zabbix_agentd Client daemon, collects client data. Such as cpu load, memory, hard disk usage, etc.
@zabbix_server server daemon. The data of zabbix_get zabbix_sender zabbix_proxy zabbix_java_getway zabbix_agentd must be submitted to the server at the end. ps: In most cases, the server actively fetches data.
Install
Software Requirements
Database MySQL 5.0.3 and above Recommended lnnodm engine Oracle 10g and above Postgresql 8.1 and above SQLite3.3.5 and above IBM db2 9.7 and above
web application Apache 1.3.12 and above PHP 5.3.0 and above
This time it is based on the lnmp architecture
Pre-time synchronization is required yum install ntp modify /etc/ntp.conf and finally add server 127.127.1.0
fudge 127.127.1.0 stratum 8
Other monitored terminals install yum install ntpdatae and synchronize time ntpdate serviceip
install zabbix
tar -zxvf zabbix-3.0.4.tar && cd zabbix-3.0.4 && ./configure --prefix=/usr/local/zabbix/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 && make && make install
There may be an error showing checking for mysql_config... no configure: error: MySQL library not found
Just look for the mysql_config file to point to hard links at compile time --with-mysql=XXXXXXXXXXXX
and so on
The zabbix server generally plays two roles: server, agent needs to monitor itself, so the appeal command parameter is also added with --enable-agent
create user
useradd -g zabbix zabbix
groupadd zabbix
Initialize the database
Zabbix server and proxy need a database. An Gentian does not need to pay special attention to the fact that the proxy only needs to import one sql file and the server needs three sql files.
Initialize the proxy database
#mysql -uroot -proot
mysql> create database zabbix default charset utf8;
mysql> quit;
#mysql -uroot -proot zabbix <database/mysql/schema.sql
Initialize the server's database
In addition to the same file above, the following two sql files must be imported
#mysql -uroot -proot zabbix <database/mysql/images.sql
#mysql -uroot -proot zabbix <database/mysql/data.sql
Configure zabbix
Configure the zabbix_server configuration file The zabbix source directory is as follows
#mkdir /etc/zabbix
#cp config/zabbix_server.conf /etc/zabbix
#vim /etc/zabbiix/zabbix_server.conf
DBName=zabbix
DBUser=root
DBPassword=root
DBPort=3306
start zabbix server
#/usr/local/zabbix/sbin/zabbix_server
Default port 10051
client
tar -zxvf zabbix-3.0.4.tar && cd zabbix-3.0.4 && ./configure --prefix=/usr/local/zabbix/ --enable-agent && make && make install
Client zabbix configuration
#vim /usr/local/zabbix/etc/zabbix-agentd.conf
Server=127.0.0.1
ServerActive=12.0.0.1
Hostname=Zabbix server
Among them, Server and ServerActive both specify the IP address of zabbixserver, the difference is that the former is passive and the latter is active. That is to say, the server allows 127.0.0.1 to read data. And ServerActive's 127.0.0.1 is that the client actively submits data to him
To install the client on other hosts, add the zabbix user
The zabbix client starts /usr/local/zabbix/sbin/zabbix_agentd
Default port 10050
zabbix manage website configuration
copy previous file
#mkdir /data/logs/nginx
#mkdir /data/site/monitor.ttlsa.com/zabbix
#cp -rp frontends/php/* /data/site/monitor.ttlsa.com/zabbix
According to your own web service configuration, ask the price to point to write
test in
mkdir -p /home/wwwroot/default/zabbix
cp -rp frontends/php/* /home/wwwroot/default/zabbix
Configure virtual hosts
Example: The following is the one-click installation lnmp used in the configuration file experiment of the web service, which can be used directly
#vim /usr/local/nginx-1.5.8/conf/vhost/monitor.ttlsa.com.conf
server {
listen 80;
server_name monitor.ttlsa.com;
access_log /data/logs/nginx/monitor.ttlsa.com.access.log main;
index index.html index.php .index.html;
root /data/site/monitor.ttlsa.com;
location /
{
try_files $uri/ /index.php?$args;
}
location ~^(.+.php)(.*)${
fastcgi_split_path_info^(.+.php)(.*)$;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info
}
}
Configure zabbix online
Open the web service domain name/zabbix
The installation interface of zabbix appears including six steps of welcome interface
PHP Requirements Check
Prompt to install what is missing. My configuration file may not take effect. Re-check the php.ini file and take effect. source
mysql data information
If an error is reported the server does not match zabbix database
The frontend does not match Zabbix database The front end does not match the database, you can re-import the sql file under the source package
#mysqk -uroot -proot zabbix <database/mysql/images.sql
#mysql -uroot -proot zabbix <database/mysql/data.sql
zabbix server details
zabbix pre-installation information checklist
If a configuration file is missing, you can download it manually and save it in the prompted directory. Click Finish again to continue the installation.
The following shows that the permissions for the user zabbix@this machine are insufficient. Access with an empty password is not allowed. You need to authorize zabbix in the database
mysql> GRANT ALL PRIVILEGES ON *.* TO zabbix@'%' identified BY 'zabbix'
-> ;
grant permission on database name. table name to user@login host identified by "user password";
the result of this operation is that if If this user already exists, modify its permissions to all, if not, create it.
The installation is complete
Log in to zabbix Log in to zabbix, default username: Admin, password: zabbix
Forgotten login password can be changed in the database
Enter the database to view the details
into the library
use zabbix;
View the details of the user zabbix The password is encrypted by md5
change the password
mysql> update users set passwd=md5("zabbix") where userid='1';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0