Zabbix-snmp
1. SNMP监控
SNMP 简单网络管理协议 simple network management protocol
为不同的种类的设备,不同厂家生产的设备,定义为一个统一的接口和协议。为了提高网络管理的效率。
工作在UDP 161端口,用于监控目标设备的操作系统、硬件设备、服务应用、软硬件配置、网络协议状态、设备性能及资源利用率、设备报错事件信息、应用程序状态等软硬件信息。
路由器 交换机 打印机 linux windows Unix
华三 华为 思科 IP地址 + SNMP协议
身份标识符:
OID object ID 对象的标识符
系统中第一个CPU 空闲状态 负载状态 IO等待状态
.1 .1.1 .1.2 .1.3
系统中第一个CPU 空闲状态 负载状态 IO等待状态
.2 .2.1 .2.2 .2.3
MIB 存放OID信息
linux中常见的设备的OID信息
[root@web02 ~]
com2sec notConfigUser default 123456
view systemview included .1
[root@web02 ~]
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
[root@web02 ~]
[root@web02 ~]
udp 0 0 0.0.0.0:161 0.0.0.0:* 68707/snmpd
[root@zabbix-server ~]
-v 1|2c|3 specifies SNMP version to use
-c COMMUNITY set the community string
[root@zabbix-server ~]
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 99
[root@zabbix-server ~]
[root@zabbix-server ~]
IF-MIB::ifPhysAddress.1 = STRING:
IF-MIB::ifPhysAddress.2 = STRING: 0:c:29:f7:1e:da
IF-MIB::ifPhysAddress.3 = STRING: 0:c:29:f7:1e:e4
[root@zabbix-server ~]
2. Zabbix的硬件监控及网站分析
物理硬件监控:
CPU温度 风扇的转速 主板的温度 电压 功率 机房巡检 监控不了硬盘的情况
IPMI
ipmitool 命令行获取这些信息
[root@web01 ~]
[root@web01 ~]
Error: Unable to establish IPMI v2 / RMCP+ session
[root@web01 ~]
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
https://blog.csdn.net/zygblock/article/details/53367664
PV UV IP监控
根据日志进行分析
开源软件:
piwik ==== matomo 自己搭建的
js代码 开发写的
Awstates 是一个免费的强大而有个性的工具,带来先进的网络,流量,FTP或邮件服务器统计图。
GoAccess 基于终端的日志分析器
第三方统计:
腾讯分析 https://ta.qq.com/
百度统计
谷歌分析
[root@web01 /code]
server {
listen 80;
server_name localhost;
root /code/discuz/upload;
location / {
index index.php index.html;
}
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;
}
}
[root@web01 /code]
[root@web01 /code]
[root@web01 /code]
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@web01 /code]
[root@web01 /code]
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2895
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database discuz;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
[root@web01 /code]
[root@web01 /code]
total 4
drwxr-xr-x 2 root root 102 2017-07-27 17:18 readme
drwxr-xr-x 12 root root 4096 2017-07-27 17:18 upload
drwxr-xr-x 4 root root 72 2017-07-27 17:18 utility
[root@web01 /code]
[root@web01 /code]
[root@web01 /code]
[root@web01 /code]
matomo
[root@web01 /etc/nginx/conf.d]
server {
listen 80;
server_name matomo.qls.com;
root /code/matomo;
location / {
index index.php index.html;
}
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;
}
}
[root@web01 /code]
[root@web01 /code]
total 18924
drwxr-xr-x 5 www www 49 2020-03-30 14:40 discuz
-rw-r--r-- 1 root root 19375918 2020-03-24 12:25 matomo-latest.zip
[root@web01 /code]
[root@web01 /code]
total 18932
drwxr-xr-x 5 www www 49 2020-03-30 14:40 discuz
-rw-r--r-- 1 root root 341 2020-03-24 12:25 How to install Matomo.html
drwxr-xr-x 12 root root 4096 2020-03-24 12:25 matomo
-rw-r--r-- 1 root root 19375918 2020-03-24 12:25 matomo-latest.zip
[root@web01 /code]
[root@web01 /code]
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3034
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database matomo;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on *.* to matomo@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
[root@web01 ~]
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3265
Server version: 5.5.64-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> drop user matomo@'localhost';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> grant all on *.* to matomo@'10.0.0.%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-gd php72w-mcrypt php72w-mbstring php72w-pdo php72w-xml php72w-fpm php72w-mysqlnd php72w-opcache php72w-pecl-memcached php72w-pecl-redis php72w-pecl-mongodb