Automated monitoring system
cacti: based monitoring software snmp (Simple Network Management Protocol) protocol, powerful mapping software Cons: template comes with the monitor is relatively small, can not monitor comes with a default alarm function (can only go to the official website to download your own template)
Nagios : plugins very much, to write their own scripts to monitor very easy to sneak into ngagios
agent-based monitoring (must have service agent on the monitored machine), the default alarm mechanism to support themselves, not the shortcomings drawing
zabbix: is based on two or more complex and more kind of monitoring mechanisms to support distributed
zabbix Software:
1. zabbix is a highly integrated monitoring solution
2. Can time enterprise of open source distributed monitoring
3. zabbix by C / S mode monitoring data acquisition C / S client / server
4. zabbix web management achieve B / S browser / server through B / S Mode
Monitoring Server S
- snmp monitoring server or agent can be used to collect data
- Data can be written like MYSQL ORACLE database
- LNMP time servers use front-end web management
Host C to be monitored
- monitored the host to install Agent
- general support for common network devices snmp
LNMP deployment environment
Installation preparation:
Monitoring Server:
- Set the host name (zabbix)
- set the IP address (192.168.1.164)
- turn off the firewall selinux
Monitoring client:
- Host web1 (192.168.1.162)
- turn off the firewall selinux
[Root @ zabbix ~] # yum -y install gcc pcre-devel openssl-devel zlib-devel # compiler installation Artifact
[root@zabbix ~]# tar -xf nginx-1.12.2.tar.gz #解包
[Root @ zabbix ~] # cd nginx-1.12.2 / # enter the directory
[root@zabbix ~]# ./configure --with-http_ssl_module
[root@zabbix ~]# make && make install #编译安装nginx
[root@zabbix ~]# yum -y install php php-mysql mariadb mariadb-devel mariadb-server #安装mariadb
[root@zabbix ~]# yum -y install php-fpm-5.4.16-42.el7.x86_64.rpm
Nginx modify the configuration file so that it can support php service
[root@zabbix tts]# vim /usr/local/nginx/conf/nginx.conf
The default is around 65-71 people commented-out line mode and change the appearance of open comment
~ LOCATION \ $ {.php
the root HTML;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index the index.php;
the include fastcgi.conf; # Note open as long as this line change on the line
}
Start Service
[Root @ zabbix tts] # systemctl restart php-fpm.service # start php-fpm Service
[Root @ zabbix tts] # ss -natulp | grep 9000 #php service using the default port is 9000 ss View
[Root @ zabbix tts] # / usr / local / nginx / sbin / nginx # start nginx service
[Root @ zabbix tts] # ss -natulp | grep 80 #ngnx to be able to view the default port 80 is a success
[Root @ zabbix tts] # systemctl restart mariadb.service # Start the database service
[Root @ zabbix tts] # ss -natulp | grep 3306 # 3306 to view the database port
Test Configuration
[root@zabbix tts]# vim /usr/local/nginx/html/ce.php
<?php
$i=33;
echo $i;
?>
:x
[root@zabbix tts]# curl http://127.0.0.1/test.php
# 33 saw 33 to be successful
Zabbix service deployment
(1) modify the service to run nginx profile settings to meet the operational requirements of service
vim /usr/local/nginx/conf/nginx.conf
http {# http written inside
include mime.types;
default_type application/octet-stream;
fastcgi_buffers 8 16k; page caching php-generated content #, 8 16K
fastcgi_buffer_size 32K; # php cache generated header information
fastcgi_connect_timeout 300; # php of connection time
fastcgi_send_timeout 300; # timeout transmission request
fastcgi_read_timeout 300; # read request timeout
:x
[Root @ zabbix tts] # / usr / local / nginx / sbin / nginx -s reload # nginx restart the service not being given is a success
(2) to compile and install zabbix Service
[root@zabbix ~]# yum -y install libevent-devel-2.0.21-4.el7.x86_64.rpm net-snmp-devel curl--devel
[Root @ zabbix zabbix-3.4.4] # ./configure --prefix = / usr / local / zabbix \ # specify the installation location
--enable-server \ # enable-server monitoring service provided
--enable-proxy --enable-agent \ # provides agency services to provide client services
--with-mysql = / usr / bin / mysql_config \ database services and the use of route ##
--with-net-snmp \ # snmp make their own support services
--with-libcurl # monitoring information can be viewed via a web page
[root@zabbix zabbix-3.4.4]# make && make install
(3) initialization zabbix
[root@zabbix ~]# systemctl restart mariadb #启动mariadb
[Root @ zabbix ~] # mysql # into the database
MariaDB [(none)]> create database zabbix charseter set utf8; # create a library and set the character set
MariaDB [(none)]> grant all on zabbix.* to zabbix@"localhost" identified by "zabbix"; #授权用户
To be continued! ! ! ! ! !