logMonitor

Zabbix10-zabbix-mysql

Zabbix10-zabbix-mysql

zabbix mysql

suo.li
一. 部署 MySQL 主从环境 通过 percona 公司提供的 zabbix 监控 mysql 的监控模板和自定义脚本来 监控 MySQL 连接数、主从同步信息、同步延迟等状态信息。 环境: hostname IP zabbix-server1 192.168.100.17 mysql-master 192.168.100.20 mysql-slave 192.168.100.22 1.1 部署 MySQL master 使用 mysql 预编译的二进制包安装 mysql-5.7.28,使用脚本一键安装 部署 mysql 主从同步,需要配置不
Zabbix09-zabbix-snmp

Zabbix09-zabbix-snmp

zabbix snmp

suo.li
监控 nginx 主要是对 nginx 的活动连接和当前状态等运行状态进行监控 一. 部署 nginx 编译安装加编译参数--with-http_stub_status_module [root@web-server-node2 nginx-1.16.1]# pwd /usr/local/src/nginx-1.16.1 [root@web-server-node2 nginx-1.16.1]# ll total 752 drwxr-xr-x 6 jack jack 326 Jan 5 16:11 auto -rw-r--r-- 1 jack jack 296463 Aug 13 2019 CHANGES -rw-r--r-- 1 jack jack 452171 Aug 13 2019 CHANGES.ru drwxr-xr-x 2 jack jack 168 Jan 5 16:11 conf -rwxr-xr-x 1 jack jack
Zabbix08-zabbix-nginx

Zabbix08-zabbix-nginx

zabbix nginx

suo.li
监控 nginx 主要是对 nginx 的活动连接和当前状态等运行状态进行监控 一. 部署 nginx 编译安装加编译参数--with-http_stub_status_module [root@web-server-node2 nginx-1.16.1]# pwd /usr/local/src/nginx-1.16.1 [root@web-server-node2 nginx-1.16.1]# ll total 752 drwxr-xr-x 6 jack jack 326 Jan 5 16:11 auto -rw-r--r-- 1 jack jack 296463 Aug 13 2019 CHANGES -rw-r--r-- 1 jack jack 452171 Aug 13 2019 CHANGES.ru drwxr-xr-x 2 jack jack 168 Jan 5 16:11 conf -rwxr-xr-x 1 jack jack
Zabbix07-zabbix-redis

Zabbix07-zabbix-redis

zabbix redis

suo.li
环境: zabbix server zabbix agent 192.168.100.17:zabbix-server1 192.168.100.12:web-server-node2 一. 安装 redis [root@web-server-node2 zabbix_agentd.d]# yum install -y redis [root@web-server-node2 zabbix_agentd.d]# vim /etc/redis.conf [root@web-server-node2 zabbix_agentd.d]# grep "^[a-Z]" /etc/redis.conf bind 0.0.0.0 protected-mode yes port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 daemonize no supervised no pidfile /var/run/redis_6379.pid loglevel notice logfile /var/log/redis/redis.log databases 16 save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /var/lib/redis slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100 appendonly no appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128
Zabbix06-zabbix监控memcached

Zabbix06-zabbix监控memcached

zabbix memcached

suo.li
环境: zabbix server zabbix agent 192.168.100.17:zabbix-server1 192.168.100.12:web-server-node2 一. 安装 memcache 服务 apt-get install memcached nmap #ubuntu [root@web-server-node2 ~]# yum install -y memcached nmap [root@web-server-node2 ~]# vim /etc/sysconfig/memcached PORT="11211" USER="memcached" MAXCONN="1024" CACHESIZE="64" OPTIONS="" [root@web-server-node2 ~]# systemctl restart memcached.service [root@web-server-node2 ~]# systemctl enable memcached.service Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service to /usr/lib/systemd/system/memcached.service. [root@web-server-node2 ~]# ss -ntl | grep 11211 LISTEN 0 1024 *:11211 *:* LISTEN 0 1024 [::]:11211 [::]:* [root@web-server-node2 ~]# lsof -i:11211 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME memcached 16305 memcached 26u IPv4 525228 0t0 TCP *:memcache (LISTEN) memcached 16305 memcached 27u IPv6 525229 0t0 TCP *:memcache (LISTEN) memcached 16305 memcached 28u IPv4 525232 0t0 UDP *:memcache memcached 16305 memcached 29u IPv6 525233 0t0 UDP
Zabbix05-监控tcp状态

Zabbix05-监控tcp状态

zabbix tcp monitor

suo.li
一. TCP 连接状态 1.1 11 种状态 1.2 端口状态转换 1.3 TCP 三次握手 1.4 TCP 四次挥手 二. 监控 TCP 连接状态 2.1 编写获取 TCP 状态的脚本 编写脚本 root@ubuntu-zabbix-server:/etc/zabbix/zabbix_agentd.d# vim get_tcp_status.sh #!/bin/bash # # Edited on 2020.03.01 by suosuoli.cn # get_status(){ STAT=$1 STAT_NU=`ss -ant | \ awk 'NR!=1{ ++status[$1] }END{ for(stats in status) print stats, status[stats] }' | \ grep "${STAT}" | \ awk '{print $2}'` if [[ ${STAT_NU} -eq 0 ]]; then STAT_NU=0 fi echo ${STAT_NU} } main(){ if [[ $# -eq 0 ]]; then echo "Usage: ./`basename $0` tcp_status <ESTAB|LISTEN|...>" fi
Zabbix04-zabbix proxy

Zabbix04-zabbix proxy

zabbix proxy

suo.li
一. Zabbix Proxy 架构 Zabbix proxy 分布式监控文档 的看风景的的看法就了速度快放假凉快圣诞节饭了示例开始讲方式凉快圣诞节饭水电费 Zabbix 通过 Zabbix proxies 为 IT 基础设施提供有效和可用的分布式监控。代理 (proxies)可用于代替 Zabbix server 本地收集数据,然后将数据报告给服务器。 zabbix 作为一个
Zabbix03-zabbix监控入门

Zabbix03-zabbix监控入门

zabbix monitor basics

suo.li
一. 使用 Zabbix 监控 Linux 系统 在需要监控的 Linux 系统安装 zabbix agent,之后从 web 界面添加该主机, 然后进行监控。 1.1 安装 zabbix agent Ubuntu # wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix- release/zabbix-release_4.0-3+bionic_all.deb # dpkg -i zabbix-release_4.0-3+bionic_all.deb # apt update # apt install zabbix-agent Centos 7 [root@web-server-node1 ~]# ip addr show eth0 | grep inet inet 192.168.100.11/24 brd 192.168.100.255 scope global noprefixroute dynamic eth0 inet6 fe80::5df7:1d43:291b:1ca4/64 scope link noprefixroute [root@web-server-node1 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm warning: /var/tmp/rpm-tmp.e98qiG: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zabbix-release-4.0-2.el7 ################################# [100%] [root@web-server-node1
Zabbix02-zabbix基础

Zabbix02-zabbix基础

zabbix basics

suo.li
一. apt/yum 安装 Zabbix 1.1 Zabbix-server 安装配置 1.1.1 准备数据库 [root@mysql-master ~]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22090 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 zabbix_server CHARACTER SET UTF8 COLLATE UTF8_BIN; Query OK, 0 rows affected (0.01 sec) ## 创建用户并授权,该用户为server和web界面用
Zabbix01-监控服务与zabbix介绍

Zabbix01-监控服务与zabbix介绍

monitor services and zabbix intro

suo.li
一. 什么是监控? 对于传统意义的监控来说,监控系统属于安防系统中应用最多的系统之一,主要是 用来监控异常和不好的事情发生,或者提供事件发生过程的记录和事后分析等功能。 如视频监控系统就是典型的监控系统,视频监控系统就从早期的 CCTV 发展到 DVR 到目前已经发