Basic operation and maintenance monitoring

First, the basic operation and maintenance monitoring
1. The reporting network / systems / services operating conditions
2. identify problems early monitoring equipment

Second, the monitoring of resource category
Hardware Monitor: CPU, memory, disk I / O
system monitoring: the survival of the state, the number of processes, the number of users, disk usage
network monitoring: the point of failure monitoring outbound traffic, inbound traffic
Application Monitoring: Web / FTP and other services, TCP / UDP port detection

Third, the monitoring service platform
Cacti --------- SNMP protocol-based monitoring software, powerful graphics capabilities
Nagios ------- Agent-based monitoring, powerful alarm mechanism. Plug-in extension
Zzbbix ------- Agent + SNMP-based monitoring of a variety of means, rich template

Four, zabbix architecture
diagram
Basic operation and maintenance monitoring

Five, linux system monitoring human
linux server detection:
the CPU load: uptime
user login: who | wc -l, / var / log secure /
number of processes: pgrep -c
network: ping, netstat, iptraf-ng

Sixth, deployment monitoring platform
1. Check the network card, set the network parameters
[root @ localhost ~] # nmcli Device Status
the DEVICE the TYPE STATE CONNECTION
virbr0 Bridge connected virbr0
ens33 ethernet disconnected -
LO the Loopback unmanaged -
virbr0 NIC-TUN not hosting -

[root@localhost ~]# nmcli connection modify ens33 ipv4.method manual ipv4.addresses 192.168.10.120/24 ipv4.gateway 192.168.10.254 ipv4.dns 8.8.8.8
[root@localhost ~]# nmcli connection up ens33
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/3)
[root@localhost ~]# hostnamectl set-hostname zbx.tedu.cn
[root@localhost ~]# hostname
zbx.tedu.cn

2. Add local deployment environment header record
[root @ zbx ~] # vim / etc / hosts
FIG.
Basic operation and maintenance monitoring

3. Replace the package is installed and enabled LAMP web platform
[root @ zbx ~] # yum -y install httpd mariadb-server mariadb php php-mysql
is loaded plugins: fastestmirror, the Langpacks
Loading Mirror SPEEDS from cached hostfile
package httpd-2.4. 6-80.el7.centos.x86_64 installed and the latest version of
the package 1: mariadb-server-5.5.56-2.el7.x86_64 installed and the latest version of
the package 1: mariadb-5.5.56-2. el7.x86_64 installed and the latest version is
being addressed dependencies
-> checking affairs
---> php.x86_64.0.5.4.16-45.el7 package will be installed
-> processing dependency php-common ( x86-64) = 5.4.16-45.el7, which is required package php-5.4.16-45.el7.x86_64
-> processing dependency php-cli (x86-64) = 5.4.16-45 .el7, it is a package php-5.4.16-45.el7.x86_64 need
---> packages will be installed php-mysql.x86_64.0.5.4.16-45.el7
-> processing dependency php- pdo (x86-64) = 5.4.16-45.el7, it is a package php-mysql-5.4.16-45.el7.x86_64 need
-> checking Services
---> Package php-cli.x86_64.0.5.4.16-45.el7 will be installed
---> packages will be installed php-common.x86_64.0.5.4.16-45.el7
-> Processing dependence relations libzip.so.2 () (64bit), it is the package php-common-5.4.16-45.el7.x86_64 need
---> the package php-pdo.x86_64.0.5.4.16-45.el7 installed
-> checking affairs
---> libzip.x86_64.0.0.10.1-8.el7 package will be installed
-> resolve dependencies completed
......... ..
already installed:
php.x86_64 0: 5.4. 16-45.el7 php-mysql.x86_64 0: 5.4.16-45.el7

It is selected as a dependency:
libzip.x86_64 0: 0 0.10.1-8.el7 PHP-cli.x86_64: 5.4.16-45.el7
PHP-common.x86_64 0: PHP-pdo.x86_64 5.4.16-45.el7 0: 5.4.16-45.el7

4. Turn on power provided from the service and run
[the root zBX @ ~] # systemctl the restart the httpd MariaDB
[zBX the root @ ~] # systemctl enable the httpd MariaDB
the Created from the symlink /etc/systemd/system/multi-user.target.wants/httpd to /usr/lib/systemd/system/httpd.service .service.
the Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service .

5. Close the firewall, disabling mechanism SElinux
[zBX the root @ ~] STOP # systemctl firewalld.service
[zBX the root @ ~] # systemctl disable firewalld.service
Removed The /etc/systemd/system/multi-user.target.wants/firewalld the symlink .service.
Removed The /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service the symlink.
[zBX the root @ ~] # the setenforce 0
[zBX the root @ ~] # Vim / etc / SELinux / config
FIG.
Basic operation and maintenance monitoring
Basic operation and maintenance monitoring

6.zabbix软件安装
(1)在线装(能访问英特网)

Basic operation and maintenance monitoring
(2)离线安装(下载必要的软件包)
使用yum本地安装
[root@zbx ~]# yum -y install zabbix-server/*.rpm
已加载插件:fastestmirror, langpacks
正在检查 zabbix-server/fping-3.10-1.el7.x86_64.rpm: fping-3.10-1.el7.x86_64
zabbix-server/fping-3.10-1.el7.x86_64.rpm 将被安装
正在检查 zabbix-server/iksemel-1.4-2.el7.centos.x86_64.rpm: iksemel-1.4-2.el7.centos.x86_64
zabbix-server/iksemel-1.4-2.el7.centos.x86_64.rpm 将被安装
正在检查 zabbix-server/php-bcmath-5.4.16-45.el7.x86_64.rpm: php-bcmath-5.4.16-45.el7.x86_64
……..
已安装:
fping.x86_64 0:3.10-1.el7 iksemel.x86_64 0:1.4-2.el7.centos
php-bcmath.x86_64 0:5.4.16-45.el7 php-mbstring.x86_64 0:5.4.16-45.el7
zabbix-agent.x86_64 0:3.4.14-1.el7 zabbix-get.x86_64 0:3.4.14-1.el7
zabbix-server-mysql.x86_64 0:3.4.14-1.el7 zabbix-web.noarch 0:3.4.14-1.el7
zabbix-web-mysql.noarch 0:3.4.14-1.el7

作为依赖被安装:
OpenIPMI-libs.x86_64 0:2.0.23-2.el7 OpenIPMI-modalias.x86_64 0:2.0.23-2.el7
php-gd.x86_64 0:5.4.16-45.el7 php-ldap.x86_64 0:5.4.16-45.el7
php-xml.x86_64 0:5.4.16-45.el7 t1lib.x86_64 0:5.1.2-14.el7
unixODBC.x86_64 0:2.3.1-11.el7

7.配置php解析环境
[root@zbx ~]# vim /etc/httpd/conf.d/zabbix.conf

Basic operation and maintenance monitoring
改时区环境保存退出

Basic operation and maintenance monitoring

8.重启httpd
[root@zbx ~]# systemctl restart httpd

9.初始化数据库
创建新库zabbix 支持UTF8字符集
授权用户zabbix 密码123 允许从本机访问
[root@zbx ~]# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, 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 character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on zabbix.* to zabbix@localhost identified by 'pwd@123';

MariaDB [(none)]> quit

Bye
[root@zbx ~]#

导入zabbix服务包提供的初始库
[root@zbx ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -ppwd@123 zabbix

10.设置好数据库连接
[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf

Basic operation and maintenance monitoring

往下 修改
DBName=zabbix //数据库名
DBUser=zabbix //数据库用户
DBPassword=pwd@123 //数据库密码

Basic operation and maintenance monitoring
Basic operation and maintenance monitoring
保存退出

七、开启zabbix相关服务
1)启动zabbix-server、zabbix-agent
[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf
[root@zbx ~]# systemctl restart zabbix-server zabbix-agent.service
[root@zbx ~]# systemctl enable zabbix-server.service zabbix-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
2)确认httpd网站服务已开启
[root@zbx ~]# systemctl restart httpd

十一、访问Web界面,按照提示完成初始设置
1)访问部署好的zabbix监控系统页面
在浏览器中访问http://192.168.10.7/zabbix/,首次访问时会自动跳转到初始化设置页面 图
单击右下方的“Next step”按钮,下一个页面会检查PHP环境,确认所有条件都是“OK”

Basic operation and maintenance monitoring

2)设置好数据库连接
比如库名zabbix、用户名zabbix、密码pwd@123点击next step
点击next step
点击next step

Basic operation and maintenance monitoring

点击finish

Basic operation and maintenance monitoring
Basic operation and maintenance monitoring
以默认管理员Admin登录Zabbix平台,zabbix默认管理员为Admin(注意第一个A为大写),密码为zabbix

Basic operation and maintenance monitoring
登录成功以后,可以看到英文版的zabbix监控网页

Basic operation and maintenance monitoring
单击zabbix监控页面右上方的头像标识,可以打开当前用户的属性设置页面
将界面语言更改为“Chinese(zh_CN)”点击updata

Basic operation and maintenance monitoring
更新成功后,zabbix监控页面就会变成中文
Basic operation and maintenance monitoring
十二、启用将Zabbix Server本机作为被监控主机
单击zabbix监控页面上的“配置”-->“主机”,可以列出被监控主机。Zabbix平台默认已将本机添加为被监控对象,但是并没有启用

Basic operation and maintenance monitoring
需要勾选Zabbix server主机项,然后单击底部的“启用”以开启监控。等待几分钟后按F5刷新网页,在“可用性”一栏下的ZBX项将会被点亮为绿色

Basic operation and maintenance monitoring

十三、确认监控项:主机可用性、可用内存、CPU负载、登录用户数、运行进程数
单击zabbix监控页面上的“配置”-->“主机”,找到被监控的主机条目,单击右侧的“监控项”可以列出所有监控项

Basic operation and maintenance monitoring

确认主机可用性监控项
监控项 Agent ping用来检查zabbix客户端的可用性

Basic operation and maintenance monitoring
确认可用内存监控项
监控项 Available memory用来检查可用内存

Basic operation and maintenance monitoring
确认CPU负载监控项
监控项 Processor load相关的用来检查CPU负载情况

Basic operation and maintenance monitoring
确认登录用户数监控项
监控项 Number of logged in users用来检查已登录用户数

Basic operation and maintenance monitoring

确认运行进程数监控项
监控项 Number of processes用来检查运行的进程数

Basic operation and maintenance monitoring
添加入站流量、出站流量监控
对于模板中没有、也没能通过自动发现创建的监控项,还可以由管理员手动添加新的监控项。单击zabbix监控页面上的“配置”-->“主机”,找到被监控的主机条目,单击右侧的“监控项”打开监控项管理页面,单击右上方的创建监控项按钮,可以配置新监控项。
1)添加入站流量监控
需要指定监控项名称、监控键值(获取监控结果的预设方法)。比如,添加对网卡ens33的入站(从此网卡进入主机)流量,对应的键值为net.if.in[ens33]

Basic operation and maintenance monitoring
Basic operation and maintenance monitoring
注意:网卡流量监控项可能会由zabbix服务端自动发现并添加,若已经完成自动发现,则此项会因为键值冲突而无法添加,也无需重复添加。
2)添加出站流量监控
添加对网卡ens33的出站(从此网卡发出)流量,对应的键值为net.if.out[ens33]
Basic operation and maintenance monitoring

3)确认新增加的监控项
返回监控项页面,可以在最后两条找到新增的监控项

Basic operation and maintenance monitoring
列出主机的监控图形
单击zabbix监控页中的“配置”-->“主机”-->选中被监控主机-->“图形”,可以看到已经创建的监控图形(默认都是从模板创建的)

Basic operation and maintenance monitoring
创建监控图形
1)添加“CPU负载分析”图形
创建新的监控图形时,需要指定名称、监控项

Basic operation and maintenance monitoring
Basic operation and maintenance monitoring
Basic operation and maintenance monitoring

确认设置无误,单击下方的“添加”就完成了
2)添加“网卡流量分析”图形
为入站流量、出站流量两个监控项创建“网卡流量分析”监控图形

Basic operation and maintenance monitoring
Basic operation and maintenance monitoring

查看监控图形
1)选择指定图形并查看
单击zabbix监控页的“监测中”-->“图形”-->选择XX图形查看,比如查看Zabbix server的CPU负载分析,如图-33所示。默认情况下,zabbix所绘制图形中的汉字会显示为方框,需要修正绘图所使用的字体

Basic operation and maintenance monitoring

2) correction in Chinese graphic display
requires the use of Chinese characters support normal font file, replace the default drawing font zabbix
[root @ zbx ~] # cp /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc / usr / report this content share / zabbix / Fonts / graphfont.ttf
cp: overwrite "/usr/share/zabbix/fonts/graphfont.ttf"? the y-
[root @ the zBX ~] #
and then press the F5 key to refresh the "CPU load analysis" page, you can see the monitor graphic characters can be displayed in the
Figure
Basic operation and maintenance monitoring
3) View "LAN traffic analysis" graphic
click zabbix monitor page "Monitoring in "->" graphics "-> select XX graphical view, such as traffic analysis Zabbix server NIC view of
Fig.
Basic operation and maintenance monitoring

Guess you like

Origin blog.51cto.com/14312470/2406506