设为首页 收藏本站
查看: 1602|回复: 0

[经验分享] zabbix3.0监控详解

[复制链接]

尚未签到

发表于 2019-1-18 10:44:20 | 显示全部楼层 |阅读模式

第1章 前言

1.1 我们的职责
  1.    保障企业数据的安全可靠。
  2.    为客户提供7*24小时服务。
  3.    不断提升用户的体验。
  http://blog.csdn.net/pan_tian/article/details/23270119
  网站可用性
所谓网站可用性(availability)也即网站正常运行时间的百分比,业界用 N 9 来量化可用性, 最常说的就是类似 49(也就是99.99%) 的可用性。
  描述    通俗叫法    可用性级别  年度停机时间
  基本可用性  2个9   99% 87.6小时
  较高可用性  3个9   99.9%   8.8小时
  具有故障自动恢复能力的可用性    4个9   99.99%  53分钟
  极高可用性  5个9   99.999% 5分钟
1.2 通过命令监控服务器
  如果想远程管理服务器就有远程管理卡,比如Dell idRACHP ILOIBM IMM
  查看硬件的温度/风扇转速,电脑有撸大师,服务器就有ipmitool。使用ipmitool实现对服务器的命令行远程管理
  查看硬件的温度/风扇转速,电脑有撸大师,服务器就有ipmitool。使用ipmitool实现对服务器的命令行远程管理
       yum -y install OpenIPMI ipmitool  #->IPMI在物理机可以成功,虚拟机不行
        [root@KVM ~]# ipmitool sdr type Temperature
        Temp             | 01h | ns  |  3.1 | Disabled
        Temp             | 02h | ns  |  3.2 | Disabled
        Temp             | 05h | ns  | 10.1 | Disabled
        Temp             | 06h | ns  | 10.2 | Disabled
        Ambient Temp     | 0Eh | ok  |  7.1 | 22 degrees C
        Planar Temp      | 0Fh | ns  |  7.1 | Disabled
        IOH THERMTRIP    | 5Dh | ns  |  7.1 | Disabled
        CPU Temp Interf  | 76h | ns  |  7.1 | Disabled
        Temp             | 0Ah | ns  |  8.1 | Disabled
        Temp             | 0Bh | ns  |  8.1 | Disabled
        Temp             | 0Ch | ns  |  8.1 | Disabled1.2.1 查看cpu的信息
[root@m01 tools]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 78
Model name:            Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Stepping:              3
CPU MHz:               2400.001
BogoMIPS:              4800.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0,1
[root@m01 tools]#1.2.2 查看系统负载
[root@m01 tools]# uptime
03:17:33 up  1:03,  2 users,  load average: 0.18, 0.05, 0.01
当前系统时间up 运行时间 2users登录的用户数 平均负载 1,5,15minutes  

  最佳负载:过去一分钟的平均负载等于CPU的核数(或者两倍)
  怎么判断服务器的负载过高:就是看你的过去1分钟的平均负载是否超过CPU的核数(或者2倍)
1.2.3 top实时动态
top - 03:27:14 up  1:13,  2 users,  load average: 0.00, 0.02, 0.00
#第一行和uptime一样
Tasks:  90 total,   1 running,  89 sleeping,   0 stopped,   0 zombie
#第二行 显示当前进程统计信息
Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  #第三行 CPU的统计信息  0.0%us,用户使用的cpu百分比 0.2%sy,系统使用CPU百分比 %id空闲的CPU百分比
Mem:   1004112k total,   395132k used,   608980k free,    26712k buffer #第四行:内存的统计信息
Swap:   786428k total,        0k used,   786428k free,   256904k cached
#第五行:swap统计信息  
   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     1 root      20   0 19352 1528 1228 S  0.0  0.2   0:01.70 init     
     2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
     3 root      RT   0     0    0    0 S  0.0  0.0   0:00.87 migration/
     4 root      20   0     0    0    0 S  0.0  0.0   0:00.01 ksoftirqd/
     5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 stopper/0
     6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
     7 root      RT   0     0    0    0 S  0.0  0.0   0:00.53 migration/
     8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 stopper/1
     9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/ 快捷键 z 加颜色 x高亮显示 > 向右> /etc/hosts
wget -O /etc/yum.repos.d/CentOS-Base.repo http://192.168.12.200/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://192.168.12.200/repo/epel-6.repo
yum clean all
yum -y install htop

1.2.6 显示磁盘信息
[root@m01 tools]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       8.8G  1.1G  7.4G  13% /
tmpfs           491M     0  491M   0% /dev/shm
/dev/sda1       190M   35M  146M  19% /boot
[root@m01 tools]#
[root@m01 tools]# dd if=/dev/zero of=tese.data bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0389443 s, 269 MB/s
[root@m01 tools]# if input file输入文件 /dev/zero 这是系统的特殊设备,能够源源不断的产生0字符流 of  output file 输出设备
bs block size 块大小
count block 快的数量 总结:产生的test.data文件大小 bs * count 经验:最佳测试磁盘写的速度的测试文件1.2.7 iotop实时查看系统io(输入输出)负载
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO   COMMAND<
1308 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % -bash
2488 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % -bash
   50 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [aio/0]
   51 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [aio/1]
   22 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [async/mgr]
   33 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ata_aux]
   34 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ata_sff/0]
   35 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ata_sff/1]
   25 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [bdi-~fault]
  773 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [bluetooth]
   19 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [cgroup]
   52 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [crypto/0]
   53 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [crypto/1]
   66 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [deferwq]1.2.8 网络太卡找iftop nethogs
yum -y install iftop nethogs
iftop:查看网卡流量(默认监控网卡eth0)
[root@m01 tools]# iftop
interface: eth0
IP address is: 10.0.0.61
MAC address is: 00:0c:29:ab:6f:34
              12.5Kb         25.0Kb        37.5Kb         50.0Kb   62.5Kb
└─────────────┴──────────────┴─────────────┴──────────────┴──────────────
10.0.0.61              => 10.0.0.253               992b   1.17Kb  1.50Kb
                        10.0.0.253                 0b      0b      0b
                        public1.alidns.com         0b     55b     91b
                       >/etc/httpd/conf/httpd.conf
        /etc/init.d/httpd start
        /etc/init.d/zabbix-server start
    服务开机启动顺序:必须先启动mysql,然后启动zabbix server
    [root@m01 ~]# tail -4 /etc/rc.local
    /etc/init.d/mysqld start
    /etc/init.d/zabbix-server start
    /etc/init.d/httpd start
    /etc/init.d/zabbix-agent start
    [root@web01 ~]# tail -1 /etc/rc.local
    /etc/init.d/zabbix-agent start3.2 zabbix客户端
客户端服务端都需要安装agent程序
        rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.9-1.el6.x86_64.rpm
客户端配置
    修改配置文件
    sed -i 's#Server=127.0.0.1#Server=172.16.1.61#' /etc/zabbix/zabbix_agentd.conf
    启动agent
    /etc/init.d/zabbix-agent start
    在服务端执行检查命令
    [root@m01 ~]# zabbix_get -s 172.16.1.61 -p 10050 -k &quot;system.cpu.load[all,avg1]&quot;
    0.000000
    [root@m01 ~]# zabbix_get -s 172.16.1.8 -p 10050 -k &quot;system.cpu.load[all,avg1]&quot;
    0.000000   
总结图示  


3.3 网页进行安装
第一步:
http://10.0.0.61/zabbix/setup.php

  第二步:点击下一步
  
  第三步:点击下一步
  
  第四步:点击下一步
  
  第五步
  
  第六步:点击完成
  
  第七步:点击完成后安装结束
  设置中文显示中文界面

  最后界面就是中文的界面了。

3.4 添加监控主机
  主机名称:zabbix程序识别用的名字
  可见的名称:给人看,显示在网页上的
  群组:同学(主机)与小组(群组)方便管理
agent代理程序的接口

  agent代理程序的接口:指定客户端IP地址


  检查客户端是否被监控的命令
[root@m01 ~]# zabbix_get -s 172.16.1.61 -p 10050 -k &quot;system.cpu.load[all,avg1]&quot;
0.090000
[root@m01 ~]# zabbix_get -s 172.16.1.8 -p 10050 -k &quot;system.cpu.load[all,avg1]&quot;
0.000000
[root@m01 ~]#3.5 添加监控主机模板

3.6 查看最新数据
  监控出现图形了,但是可能会出现乱码
解决中文乱码
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
    yum -y install wqy-microhei-fonts
    \cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

第4章 zabbix自定义监控
4.1 被监控主机修改配置文件
web01客户端执行
[root@web01 ~]# sed -i '293a UserParameter=login-user,who|wc -l' /etc/zabbix/zabbix_agentd.conf [root@web01 ~]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
[root@web01 ~]#
服务端操作
[root@m01 ~]# zabbix_get -s 172.16.1.8 -p 10050 -k &quot;login-user&quot;
1
[root@m01 ~]#4.2 网页上添加自定义监控
4.2.1 添加模板
  模板的功能:一处创建,处处使用


4.2.2 添加应用集:一个目录,统一存放具有相关性的监控项
  
  
  
4.2.3 添加监控项
  告诉服务端server你该去哪里获取什么方面数据



4.2.4 添加触发器
  需要报警的监控项设置触发器
  严重性:
²  警告级别的报警发给初级运维
²  一般严重级别的报警发给初级运维,中级运维
²  严重级别的报警发给初级运维,中级运维,高级运维
²  灾难级别的报警发给初级运维,中级运维,高级运维,总监





4.2.5 添加图形




4.2.6 使用模板


第5章 报警
5.1 报警种类
  邮件报警:存在收不到的风险
  微信报警:通知及时
  短信报警:不依赖网络
  电话报警:有信号就可以报警
  APP报警
5.2 安装报警客户端
2安装 Agent
1.切换到zabbix脚本目录(如何查看zabbix脚本目录):
vi /etc/zabbix/zabbix_server.conf
查看AlertScriptsPath
cd /usr/lib/zabbix/alertscripts/
2.获取OneITSM agent包:
wget http://www.iyunv.com/agent/release/oneitsm_zabbix_release-1.0.0.tar.gz tar -zxf oneitsm_zabbix_release-1.0.0.tar.gz
cd oneitsm/bin
bash install.sh 7145112f-7f7a-8cfb-cd26-810036d6d479 start to create config file...
Zabbix管理地址: 10.0.0.61/zabbix
Zabbix管理员账号: Admin
Zabbix管理员密码:
start to auth by zabbix admin user and password...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    70    0    70    0   125    847   1514 --:--:-- --:--:-- --:--:--     0
auth success!
start to create mediatype...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
397   130  130   130    0   267   2706   5559 --:--:-- --:--:-- --:--:--     0
media type resonse:{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;error&quot;:{&quot;code&quot;:-32602,&quot;message&quot;:&quot;Invalid params.&quot;,&quot;data&quot;:&quot;Media type \&quot;oneitsm media\&quot; already exists.&quot;},&quot;id&quot;:1}
create media type failed! error message:{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;error&quot;:{&quot;code&quot;:-32602,&quot;message&quot;:&quot;Invalid params.&quot;,&quot;data&quot;:&quot;Media type \&quot;oneitsm media\&quot; already exists.&quot;},&quot;id&quot;:1}
[root@m01 bin]#

第6章 监控可视化
6.1 聚合图形
  聚合图形:将同一类型的监控放在一起看,容易对比分析






6.2 幻灯片演示
  幻灯片:轮流播放聚合图形
       . 模板的共享
       https://github.com/zhangyao8/zabbix-community-repos
       https://share.zabbix.com/


第7章 应用服务监控
7.1 监控rsync服务端口
1.      创建一个监控认识有哪些服务端口的模板


2.      添加一个应用集


3.      新建一个监控项

4.      添加触发器


7.2 监控NFS服务器,使用监控NFS进程来判断NFS服务器正常
  
怎么监控进程?
        proc.num[,,,]   进程数。返回整数
        zabbix_get -s 172.16.1.8 -p 10050 -k 'proc.num[nginx]'
[root@m01 bin]# zabbix_get -s 172.16.1.31 -p 10050 -k &quot;proc.num[nfsd]&quot;
8
[root@m01 bin]#  怎么监控端口?
        net.tcp.listen[port]    检查 TCP 端口 是否处于侦听状态。返回 0 - 未侦听;1 - 正在侦听
        net.tcp.port[,port] 检查是否能建立 TCP 连接到指定端口。返回 0 - 不能连接;1 - 可以连接 [root@m01 bin]# zabbix_get -s 172.16.1.8 -p 10050 -k 'net.tcp.port[,80]'
        1
        [root@m01 bin]# zabbix_get -s 172.16.1.8 -p 10050 -k 'net.tcp.port[,873]'
        1
        [root@m01 bin]# zabbix_get -s 172.16.1.8 -p 10050 -k 'net.tcp.port[873]'
        ZBX_NOTSUPPORTED: Invalid second parameter.7.3 监控3web服务器
网页创建模板进行监控80端口
三个web服务器中进行web检测
写脚本
[root@web01 conf]# cat  /server/scripts/nginx_check.sh
char=`curl -s http://10.0.0.8/test.html`
[ &quot;$char&quot; == &quot;oldboy&quot; ] && echo 1 ||echo 0
[root@web01 conf]#
写模板文件
[root@web01 conf]# cat  /etc/zabbix/zabbix_agentd.d/userparameter_nginx.conf
UserParameter=nginx_check,/bin/sh /server/scripts/nginx_check.sh
[root@web01 conf]#
重启客户端
[root@web01 conf]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
监控机进行测试
[root@m01 bin]# zabbix_get -s 172.16.1.8 -p 10050 -k &quot;nginx_check&quot;
1
[root@m01 bin]# zabbix_get -s 172.16.1.7 -p 10050 -k &quot;nginx_check&quot;
1
[root@m01 bin]# zabbix_get -s 172.16.1.9 -p 10050 -k &quot;nginx_check&quot;
1
[root@m01 bin]#
[root@m01 bin]# zabbix_get -s 172.16.1.7 -p 10050 -k &quot;nginx_check&quot;
0  #0是不正常1是正常
[root@m01 bin]#7.4 监控mysql
  如何排查自定义监控报错:
UserParameter=key,shell command
1. 现在命令行测试你的shell command的结果和你的期望是否一致
[root@web01 ~]# mysqladmin -uroot -poldboy123 ping 2>/dev/null|grep -c alive
1
2. 将符合预期的shell command写入到我们的自定义监控文件中
UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping | grep -c alive
改为
UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin -uroot -poldboy123 ping 2>/dev/null|grep -c alive
3. 改完配置文件记住重启生效
4. 在服务端用zabbix_get命令
[root@db01 zabbix_agentd.d]# tail -2 userparameter_mysql.conf
UserParameter=mysql.ping,/application/mysql/bin/mysqladmin -uroot -p123456  ping 2>/dev/null | grep -c alive
UserParameter=mysql.version,mysql -V
重启
[root@db01 zabbix_agentd.d]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
服务端测试
[root@m01 zabbix_agentd.d]# zabbix_get -s 172.16.1.51 -p 10050 -k 'mysql.ping'
0#发现mysql命令找不到 在客户端模板配置文件里面命令使用绝对路径
[root@m01 zabbix_agentd.d]# zabbix_get -s 172.16.1.51 -p 10050 -k 'mysql.ping'
1
[root@m01 zabbix_agentd.d]#7.5 监控URL地址来更精确的监控我们的网站运行正常





  最后在监测中查看web监测

7.6 监控Nginx7种连接状态
修改配置加入server标签
[root@web03 ~]# cat /application/nginx/conf/nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
######status#########
    server {
        listen       127.0.0.1:80;
            stub_status on;
            access_log off;
        }
server {
        listen       10.0.0.9;
        location / {
            root   html;
            index  index.html index.htm;
                   }
      }
include extra/www.conf;
include extra/bbs.conf;
include extra/blog.conf;
}
重启服务
检查状态
[root@web03 ~]# curl 127.0.0.1/nginx_status
Active connections: 1
server accepts handled requests
8 8 8
Reading: 0 Writing: 1 Waiting: 0
[root@web03 ~]#
[root@web03 ~]# cat >> /etc/zabbix/zabbix_agentd.d/userparameter_nginx_status.conf  UserParameter=nginx_accepts,curl -s  127.0.0.1/nginx_status|awk 'NR==3 {print $1}'
> UserParameter=nginx_handled,curl -s  127.0.0.1/nginx_status|awk 'NR==3 {print $2}'
> UserParameter=nginx_requests,curl -s  127.0.0.1/nginx_status|awk 'NR==3 {print $3}'
> UserParameter=nginx_reading,curl -s  127.0.0.1/nginx_status|awk 'NR==4 {print $2}'
> UserParameter=nginx_writing,curl -s  127.0.0.1/nginx_status|awk 'NR==4 {print $4}'
> UserParameter=nginx_waiting,curl -s  127.0.0.1/nginx_status|awk 'NR==4 {print $6}'
> END
[root@web03 ~]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
[root@web03 ~]#
服务端测试
[root@m01 bin]# zabbix_get -s 172.16.1.8  -p 10050 -k &quot;nginx_waiting&quot;
Reading: 0 Writing: 1 Waiting: 0
[root@m01 bin]# zabbix_get -s 172.16.1.8  -p 10050 -k &quot;nginx_accepts&quot;
58 58 58
[root@m01 bin]#
网页进行自定义监控






  

第8章 自动发现和自动注册
8.1 自动发现:服务端发现客户端
  服务端自动发现局域网中所有的客户端agent(主动模式)
优点:方便找到所有的客户端,不会遗漏
  缺点:一旦agent过多,server压力很大,每隔一段时间server会扫描一次局域网中的所有机器








8.2 自动注册:客户端主动到服务端登记信息
  所有的客户端agent主动去服务端server登记注册(小弟上门求收留)被动模式
  优点:对服务端的压力最低。
  缺点:配置过程稍微复杂
  应用场景:当自动发现时,server端压力过大时,用自动注册
修改配置文件
[root@web03 zabbix_agentd.d]# sed -i 's#Hostname=Zabbix server#Hostname=web03#' /etc/zabbix/zabbix_agentd.conf
[root@web03 zabbix_agentd.d]# sed -i 's#ServerActive=127.0.0.1#ServerActive=172.16.1.61#' /etc/zabbix/zabbix_agentd.conf [root@web03 zabbix_agentd.d]#  sed -i '176a HostMetadataItem=system.uname' /etc/zabbix/zabbix_agentd.conf
重启
[root@web03 zabbix_agentd.d]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
[root@web03 zabbix_agentd.d]#









  第9章 分布式监控
  默认只能监控同一个局域网的机器
  一台sever的监控主机数量是有限的
  功能:
能够减轻服务端的压力
zabbix server 只能在同一个局域网中监控
9.1 常规安装部署
9.1.1 在客户端进行下载安装
[root@web01 tools]# wget http://192.168.12.200/zabbix/zabbix-proxy-mysql-3.0.9-1.el6.x86_64.rpm
echo &quot;192.168.12.200 mirrors.aliyun.com&quot; >> /etc/hosts
wget -O /etc/yum.repos.d/CentOS-Base.repo http://192.168.12.200/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://192.168.12.200/repo/epel-6.repo
yum clean allyum -y  localinstall zabbix-proxy-mysql-3.0.9-1.el6.x86_64.rpm9.1.2 安装配置数据库
zabbix proxy需要数据库存储相关配置,但不存储监控数据
生产环境:在proxy
1  
mysql> create database zabbix_proxy character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.06 sec)
mysql> grant all privileges on zabbix_proxy.* to zabbix@'172.16.1.%' identified by 'zabbix';
Query OK, 0 rows affected (0.15 sec)
mysql>9.1.3 导入sql文件
web客户端传文件到服务端
scp /usr/share/doc/zabbix-proxy-mysql-3.0.9/schema.sql.gz 10.0.0.61:/server/
m01导入文件
zcat /server/schema.sql.gz |mysql -uroot   zabbix_proxy9.1.4 配置文件修改
vim /etc/zabbix/zabbix_proxy.conf
Server=10.0.0.61
Hostname=web01
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=zabbix DBHost=172.16.1.619.1.5 启动并检查日志
[root@web01 tools]# /etc/init.d/zabbix-proxy start
Starting Zabbix proxy:                                     [  OK  ]
[root@web01 tools]# tailf /var/log/zabbix/zabbix_proxy.log
39637:20171013:113558.590 cannot send heartbeat message to server at &quot;172.16.1.61&quot;: proxy &quot;web01&quot; not found
39651:20171013:113558.608 proxy #16 started [housekeeper #1]
39652:20171013:113558.618 proxy #17 started [http poller #1]
39654:20171013:113558.619 proxy #19 started [history syncer #1]
39650:20171013:113558.621 proxy #15 started [icmp pinger #1]
39653:20171013:113558.621 proxy #18 started [discoverer #1]
39655:20171013:113558.626 proxy #20 started [history syncer #2]
39658:20171013:113558.639 proxy #23 started [self-monitoring #1]
39657:20171013:113558.642 proxy #22 started [history syncer #4]
39656:20171013:113558.648 proxy #21 started [history syncer #3]9.1.6 配置zabbix agent
[root@web01 ~]# sed -i 's#172.16.1.61#172.16.1.8#g' /etc/zabbix/zabbix_agentd.conf
[root@web01 ~]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
[root@web01 ~]#9.2 开始网页操作部署
  将代理节点注册到zabbix server





第10章 snmp监控(交换机监控)
  能用zabbix agent:系统能够安装zabbix软件的时候用,交换机打印机等智能设备不能使用zabbix程序。
  SNMP是专用来设备监控
  优点:软件小巧,所以设备都可以安装使用
  缺点:支持功能少
  生产环境建议:先安装使用agent,若不能安装则使用SNMP
10.1 Linux系统安装启动服务
[root@m01 server]# rpm -qa |grep snmp
net-snmp-5.5-60.el6.x86_64
net-snmp-utils-5.5-60.el6.x86_64
net-snmp-libs-5.5-60.el6.x86_64
[root@m01 server]#
没有就安装
    yum -y install net-snmp net-snmp-utils
配置snmp
[root@m01 ~]# sed -i.ori '57a view systemview   included  .1' /etc/snmp/snmpd.conf
[root@m01 ~]# [root@m01 ~]# /etc/init.d/snmpd start
Starting snmpd:                                            [  OK  ]
[root@m01 ~]#
使用
[root@m01 ~]# snmpwalk -v 2c -c public 127.0.0.1 sysname
SNMPv2-MIB::sysName.0 = STRING: m01
[root@m01 ~]# [root@m01 ~]# snmpwalk -v 2c -c public 127.0.0.1 sysContact
SNMPv2-MIB::sysContact.0 = STRING: Root  (configure /etc/snmp/snmp.local.conf)
[root@m01 ~]# snmpwalk -v 2c -c public 127.0.0.1 SysService
SNMPv2-MIB::sysServices = No Such Instance currently exists at this OID
[root@m01 ~]# snmpwalk -v 2c -c public 127.0.0.1 hrSWRunName
HOST-RESOURCES-MIB::hrSWRunName.1 = STRING: &quot;init&quot;
HOST-RESOURCES-MIB::hrSWRunName.2 = STRING: &quot;kthreadd&quot;
HOST-RESOURCES-MIB::hrSWRunName.3 = STRING: &quot;migration/0&quot;
HOST-RESOURCES-MIB::hrSWRunName.4 = STRING: &quot;ksoftirqd/0&quot;
HOST-RESOURCES-MIB::hrSWRunName.5 = STRING: &quot;stopper/0&quot; 说明: http://www.ttlsa.com/monitor/snmp-oid/10.2 在网页上配置使用








运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-664725-1-1.html 上篇帖子: zabbix企业应用之discovery监控交换机流量 下篇帖子: zabbix服务器迁移
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表